Re: [Java-gnome-developer] list of visible rows in table, combobox and etc.
Brought to you by:
afcowie
|
From: Andrew C. <an...@op...> - 2009-12-08 22:53:09
|
On Tue, 2009-12-08 at 22:26 +0300, Alexey Titov wrote: > I have a table with many rows. How can I know which rows are currently > visible? Hm. Not sure. GTK seems to have a gtk_tree_view_get_visible_range(), http://library.gnome.org/devel/gtk/stable/GtkTreeView.html#gtk-tree-view-get-visible-range does that do what you want? If so, you might try writing a binding for it as TreeView's getVisibleRangeStart() and getVisibleRangeEnd(). > When scrolling occurs or table resizes new rows becomes > visible. If you want to pay attention to scrolling, you'd can hook up to the Adjustment.ValueChanged signal via TreeView's getVAdjustment(), http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/TreeView.html#getVAdjustment() I've used that very successfully in other situations. And, of course, you can ask a Widget what Allocation it has been given, though that's not really what you're after. http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/Widget.html#getAllocation() AfC Sydney |