Re: flow layout container possible?



Hi Havoc, Rob -

thanks for the heads up.  I'm CC'd on the bug now and will follow its progress.

In the meantime, I've imported that gimp widget (well, with HWrapBox too as apparantly WrapBox cannot be used on its own) and I've got it working!  I will use this for now, but I'll probably convert it into C++ in order to fit in with the project more.

My needs for the container are a bit trimmed down too, I don't really need it as a general purpose container, it will only contain a certain type of widget, so perhaps I can take some shortcuts.  I don't see the point in making this nice big generic class that no one will use becuase it's not part of some library.  I'll just wait for the changes talked about in the bug to get propogated in and then do something from there.

thanks again guys.

dave


On Tue, Jul 8, 2008 at 1:08 PM, Robert Staudinger <robert staudinger gmail com> wrote:
Hi,

look at http://developer.gimp.org/api/2.0/app/GtkWrapBox.html .
This is what the gimp toolbox uses.

- Rob

On Tue, Jul 8, 2008 at 7:06 PM, Robert Staudinger
<robert staudinger gmail com> wrote:
> Hi all,
>
> Forgive me if this should be on the app devel list.  I have a need in
> my application for a "flow container", a concept I first learned about
> when working with Java (swing, I think).  It also exists in
> Windows.Forms and QT.  Essentially, it is a container that contains
> widgets, in order of addition from left to right, similar to an HBox,
> but once it exhausts all its available horizontal space, it creates
> another row and continues the same pattern.
>
> Here's some terrible ASCII art:
> | [ Button ] [ Button 2 ] [ Button 3 ]  |
> | [ Button 4] [ Button 5 ]                  |
>
> The problem I see with implementing such a container in GTK is that
> on_size_request (I'm a C++ developer, so bear with me on the gtkmm
> talk) doesn't give any hints as to an idea of the dimensions that I
> will have to work with.  The flow container is more of a "give me one
> dimension and i'll give you the other" container, so if I am given an
> approximate width, I can compute the height.
>
> Does anyone see a way to accomplish this?
>
> oh, btw, for completeness I tried Murray Cumming's FlowTable [1] in
> Glom but it's not quite the same idea.  In that implementation, you
> have to know the number of columns you want to break it into before
> hand.
>
> thanks, and cheers to those at GUADEC.
> dave
>
>
> [1] http://svn.gnome.org/viewvc/glom/trunk/glom/utility_widgets/flowtable.cc?view=markup
>



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