Re: GtkAlignment makes things smaller, but surrouning don't get bigger



On Mon, Mar 07, 2005 at 10:56:30PM -0500, Owen Taylor wrote:
> On Mon, 2005-03-07 at 18:32 -0800, Ben Johnson wrote:
> 
> > this is more or less what I'm doing...
> > 
> >   mydialog = gtk_dialog_new ();
> >   gtk_window_set_title        (GTK_WINDOW (mydialog), "Payment Amount");
> >   gtk_window_set_position     (GTK_WINDOW (mydialog), GTK_WIN_POS_CENTER);
> >   gtk_window_set_modal        (GTK_WINDOW (mydialog), TRUE);
> >   gtk_window_set_default_size (GTK_WINDOW (mydialog), 320, 350);
> >   gtk_window_set_type_hint    (GTK_WINDOW (mydialog), GDK_WINDOW_TYPE_HINT_DIALOG);
> > 
> >   vbox8 = GTK_DIALOG (mydialog)->vbox;
> >   gtk_widget_show (vbox8);
> > 
> >   mycalculator = createcustwidgetfunc_enterpaymentdlg_handleamount ("mycalculator", "", "", 0, 0);
> >   gtk_widget_show (mycalculator);
> >   gtk_box_pack_start (GTK_BOX (vbox8), mycalculator, TRUE, TRUE, 0);
> >   GTK_WIDGET_UNSET_FLAGS (mycalculator, GTK_CAN_FOCUS);
> >   GTK_WIDGET_UNSET_FLAGS (mycalculator, GTK_CAN_DEFAULT);
> > 
> >   alignment14 = gtk_alignment_new (0.5, 0.5, 1, 0.5);
> >   gtk_widget_show (alignment14);
> >   gtk_box_pack_start (GTK_BOX (vbox8), alignment14, TRUE, TRUE, 0);
> 
> Try making this FALSE, FALSE ... you've said "if you have excess space,
> give it to vbox8 and alignment14 equally.

that results in the calculator widget taking up all available space the
and hbox11 being too short/small.  If I use FALSE, FALSE there is no
need to use an alignment.  I want the hbox11 buttons to grow, but not
too much.  I also want the calculator buttons to be a good middle of the
road size.  and I want no space between.


> >   hbox11 = gtk_hbox_new (TRUE, 0);
> >   gtk_widget_show (hbox11);
> >   gtk_container_add (GTK_CONTAINER (alignment14), hbox11);
> > 
> > After that I add some buttons to hbox11 setting the fill and expand
> > properties to TRUE (which doesn't affect the layout).  So... all expand
> > and fill props (that I know of) are set to TRUE and the alignment has
> > default values except the yscale is set to .5.
> > 
> > The result of this is hbox11 takes up less space and mycalculator
> > doesn't take up any additional space, leaving some empty space around
> > hbox11.
> > 
> > if I change the alignment so that it doesn't get any smaller,
> > 
> >   alignment14 = gtk_alignment_new (0.5, 0.5, 1, 1);
> > 
> > ...then the hbox11 is too big.
> > 
> > If I instead change either the expand or fill props on alignment14 to
> > false then I wind up with hbox11 being too small, regardless of what the
> > yscale is set to.  setting expand to false results in the calculator
> > widget taking up the available space.  leaving expand set to true and
> > setting fill to false results in too small box11 buttons with a lot of
> > wasted goofy looking space.
> 
> You aren't making sense here. Where do you want the excess space - 
> the "calculator" or the hbox at the bottom? Both? Make a decision.

- I want *all* the excess space consumed.
- I want some of the space to be used by the calculator, and
- I want some space to be consumed by the buttons in hbox11.

currently:
- If I set expand on *any* widgets to FALSE, they end up too small.
- If I set expand on *all* widgets to TRUE, some widgets take up more
  space than I want them to.
- If I try to use a GtkAlignment object to control the growth of the
  widgets that are getting too big, I create *excess* space that is not
  consumed by uncontrolled widgets.

Thanks,

- Ben




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]