Il giorno mar, 03/01/2012 alle 14.42 +0100, Jérôme ha scritto:
> Hi.
> 
> There's something I don't get with the behaviour of homogeneous in Gtk.Box. I
> guess there must be a reason for it working this way. I just don't get the
> logic.

I may be wrong, but to me it looks the logic is much simpler than what
you expect. You expect a left alignment, but there is no reason why it
should be. If I understand correctly, "pack_start" and "pack_end" refer
to the _order_ of widgets, and not to any alignment of the widgets as a
whole.

So if there is no left/right alignment rule, the default is just to
distribute them on all the available space, leaving the same empty space
among them or, if you instead set "homogeneous", allocating to each the
same space, which will then possibly be partly empty.

Your logic could make sense, it is just based on more assumptions.


> [...]
> What I would expect :
> -------------------
> 
> 2.a/
> homogeneous = True
> expand = False
> fill = whatever
> -> Objects would be of the same size : the size of the largest one, and they
> would be left-aligned (pack_start() being used).
> 
> [| a ||abc||   |      ]
> 
> [...]
> 
> This seems more logical to me. I can't figure out why it does not work this
> way. 
> 
> Besides, I don't see how to obtain 2.a/ any other way.
> 

(craf already replied to you, but I had already wrote what follows:)

I see at least 2 ways: turn the "homogeneous" flag off, and all "expand"
to the False, then
1) put the last object in a GtkAlignment, make it (the child) appear on
the left, and the "Expand" flag of the GtkAlignment to True, or
2) pack, after the last object, another GtkAlignment, or even a
DrawingArea or a Label (again, with the "Expand" flag to true). 

I anticipate that your reaction will be "but those are ugly hacks", and
I guess - but again, I might be wrong - the answer of the developers
would be "what you're trying to do is ugly".


bye

Pietro

_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to