Re: GtkSpreadTable ('spread-table' branch)



On Thu, 2010-10-07 at 12:37 +0900, Tristan Van Berkom wrote:
> Hello list again,
>    Now for the introduction of GtkSpreadTable (still open for
> a better name for this widget).
> 
> What the spread table container does is takes a linear list
> of widgets, which can be of variable size and spread/distribute
> the widgets as evenly as possible according to their size
> across a fixed number of rows or columns. Thus requiring the
> smallest size possible while maintaining the fixed number
> of columns or rows.
> 
> For instance when oriented vertically, widgets will be listed
> top-down with the first widget in the top-left corner and the 
> last widget on the bottom right; widgets will be lined up in 
> such a way to require the least height as possible.
> 
> This widget is the one that actually meets the requirements 
> for Glom[0].
> 
> To get a better idea of how this works you can checkout and 
> build the 'spread-table' branch I added to GTK+ yesterday... 
> fire up the ./tests/testspreadlayout demo.

Some quick links might be helpful
http://git.gnome.org/browse/gtk+/log/?h=spread-table
http://git.gnome.org/browse/gtk
+/tree/gtk/gtkspreadtable.h?h=spread-table

I have already wrapped this in a branch of gtkmm, and even used it in
Glom instead of my custom code. It seems to work fine for me.

Some small suggestions:
1.
I think lines should be lines_count.

2.
I'd like a get_widget_line(GtkWidget*) function so I can discover what
line (column in my case) the widget is currently in. I'd like to query
that whenever the allocation changes, so that I can align some child
widgets (children of HBoxes in columns of the GtkSpreadTable) via a
GtkSizeGroup. Obviously I only want widgets in a GtkSizeGroup (so they
have the same width) that are in the same column.

This is fairly unusual, but this is the first widget that has such
dynamic layout so you can't predict at compile time where the widgets
will appear in relation to each other.


-- 
murrayc murrayc com
www.murrayc.com
www.openismus.com



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