Suppose I have the following layout in GTK4: A vertical box in a window containing three child widgets:
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Widget 1 ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ ┃
┃ ┃
┃ Text View ┃
┃ ┃
┃ ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ Widget 2 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Where The Text View
has the vexpand property set to true. I'm running into the following issue: when the text view gets large enough (by inserting lines), the box expands beyond the size of the window, pushing widget 2 out of visibility.
How can I make sure that the text view is limited in size by the parent box/window?
From what I can see/find, the solution is likely related to size requests, but I'm not sure how to dynamically calculate what the maximum size of the text view should be. (Note that I'm working on a way to add multiple text views which are vertically/horizontally separated, so Ideally I'd like a general solution where the widget can still resize when the conditions/layout change.