How to prevent GtkAspectFrame space corruption?

<interface> <object class='GtkWindow' id='window'> <child> <object class='GtkBox' id='box'> <property name='orientation'>horizontal</property> <child> <object class='GtkAspectFrame' id='aspect_frame'> <property name='xalign'>0.0</property> <property name='yalign'>0.0</property> <child> <object class='GtkDrawingArea' id='drawing_area_A'> <property name='expand'>TRUE</property> </object> </child> </object> </child> <child> <!-- widget B goes here --> </child> </object> </child> </object> </interface> 

The above GtkBuilder UI definition creates the DrawingArea A square. I want it to be as large as possible in its window, so I set the expand property A to TRUE . However, when the window itself is wider than the height, I want widget B to fill in the remaining width not used by the drawing area. Basically, I want this:

 +--------------------+ |+-----------++-----+| || || || || A || B || || || || || || || |+-----------++-----+| +--------------------+ 

But I get this instead (if B has expand set to FALSE ):

 +--------------------+ |+-----------+ +-+| || | | || || A | |B|| || | | || || | | || |+-----------+ +-+| +--------------------+ 

Or this (if B has expand set to TRUE ):

 +--------------------+ |+-------++---------+| || || || || A || B || || || || |+-------+| || | +---------+| +--------------------+ 

How do I get GTK to work together?

+8
gtk gtk3
source share
1 answer

I believe that A should be expand = true, fill = true, and B should expand = false and fill = true.

0
source share

All Articles