Re: complex packing problem



Hello,

Take a look at Gtk::Table, It allows fixed grid, with predefined rows and cols.

> Can anyone suggest a general strategy for making this work? In practice, the number of widgets will be in the hundreds, not 12.

I don't know what kind of widgets do you want to display. In my opinion, it is a bad idea to store (and create of course) all the hundreds. Just try to add the fixed number of widgets (for example, 3x4 as you want, or fill the screen with them and nothing more). Then add Gtk::VScrollbar at the right of the Table, and then update the data on these widgets according to the scrollbar value.

If you tell, what widgets you want to place, the strategy might be slightly different.

Sincerely,
Vlad Volodin

ps Sorry for additional post, I've forgot to send the letter to mail-list.

2009/2/26 Joaquim Schmidlap <schmidlap schmidlap org>
I have a large number of small, identical widgets that I need to arrange in a grid. The trick is, I want the dimensions of the grid to change with the toplevel's window size, and the widgets to be packed in a linear order that tracks the grid dimensions.

For example, if I have 12 widgets A - L, and the toplevel is approximately square, I want them to pack this way:

A  E  I
B  F  J
C  G  K
D  H  L

But if the user resizes the window to be long and skinny left-to-right, I want them to go this way:

A  C  E  G  I  K
B  D  F  H  J  L

Similarly, if the user makes the window skinny vertically:

A  G
B  H
C  I
D  J
E  K
F  L

Can anyone suggest a general strategy for making this work? In practice, the number of widgets will be in the hundreds, not 12.


_______________________________________________
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]