Re: question on Gtk::Bin



Matthias Langer wrote:
> I'm often in the situation to add a single widget to a containter of
> type Gtk::Bin (mostly frames). Because I can't modify the way the widget
> is packed into the container with add(...) I normaly add a Gtk::(H/V)Box
> first, and then into this box the widget i would have normally inserted
> directly. An example:
> 
> frame.add(hbox);
> hbox.pack_start(some_widget, PACK_EXPAND_PADDING);
> 
> While this approach works fine, i'm woundering if there may be a more
> elegant solution ...

I think that was a design decision with gtk+ in order to allow for
interfaces that are right->left or down->up rather than the traditional
up->down left->right which follows our writing conventions (notice how
it is by default impossible to firmly place widgets) , and a frame is
supposed to hold only one widget which should by default expand to size
(gnome human interface guidelines)... this is supposed to make apps look
alike across developpers, at least that's what I understood from the
gnome 2.0 developer's manual

Although I do agree that sometimes the limitation makes apps harder to
use: imagine a row of buttons in an image viewer, using a button box
does not work because you cannot specify the buttons to be centered in
the middle, so one needs to use an hbox and an alignment, add the
buttons to the hbox with expand_widget and then align them centered with
the alignment...

> Matthias Langer
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 




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