Well, I think it should be straightforward to make it dynamic but I
may be wrong. Currently, sizing is done from the toplevel widget down
to the most inner ones. If you resize an inner widget, either you've
already enough space (request vs. alllocated) or you need to tell your
parent that more space is needed. If the parent can grant you more
space, then you're done. If it cannot, then it must tell its parent
that more space is needed and so on up to the toplevel widget which
the only one that can freely resize itself (since it has no parent).
Nicolas
On Jun 6, 2:33 pm, Tristam MacDonald <[email protected]> wrote:
> On Sat, Jun 6, 2009 at 6:30 AM, Nicolas Rougier
> <[email protected]>wrote:
>
>
>
>
>
> > Thanks. I've improved the code to handle Vertical & Horizontal boxes.
> > The result is pretty flexible and rather simple to write.
> > You're free to specify any size for any widget or let the layout find
> > the minimum required size to handle all the stuff (if possible).
>
> > Here are two screenshots:
> >http://www.loria.fr/~rougier/tmp/glydget-1.png
> >http://www.loria.fr/~rougier/tmp/glydget-2.png
>
> > And the code is available at:
> >http://www.loria.fr/~rougier/tmp/glydget.tgz
>
> > The big part of the algorithm lies in the box class that tries to
> > honor child size request based on children homogeneity, expandable
> > properties, spacers and border.
>
> > The window class shows how to make a layout using a close button, a
> > title area, a status bar, a sizer button and a content area using only
> > vbox and hbox.
>
> > Hope that helps.
>
> > Nicolas
>
> I like what you have done here, but not sure I see a good way to make this
> dynamic, i.e. add the ability to recalculate layouts on the fly as items are
> added and removed (or collapsed/expanded for dynamic items).
> I think there are some sticky issue re who will resize who, and in what
> order, though I may be missing something basic.
> --
> Tristam MacDonaldhttp://swiftcoder.wordpress.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---