Re: Gtk2-Perl equivalent to Gtk::CList::row_is_visible method



On Mon, 2004-04-05 at 19:54, Niel Das wrote:

I am wondering if there is an equivalent method and/or process to the 
Gtk CList's, Gtk::CList::row_is_visible($row) call?  

There's no direct equivalent, only a hackish workaround: Use
Gtk2::TreeView::get_cell_area with the path and column you want to test
and check the y and height fields of the returned rectangle:

  my $rectangle = $slist -> get_cell_area($path
                                          $slist -> get_column(0));

For what to do with $rectangle -> y and $rectangle -> height, see

http://mail.gnome.org/archives/gtk-app-devel-list/2003-November/msg00170.html

All that isn't really simple anymore, so what do you (all) think about a
helper method like the one implemented in the attached patch?  I chose
"row_visible" because that is consistent with GtkTreeView's
"row_expanded" - "row_is_visible" might be a better name.

I am looking at the Gtk2::TreeViewColumn and Gtk2::CellRenderer modules, 
since I think those are the modules that determine how a GtkTreeView is 
displayed... However I cannot seem to notice an equivalent.

That kind of functionality is usually found in GtkTreeView. 
GtkTreeViewColumns are just GtkCellRenderer arrays that control how the
cells are drawn, but the whole thing is managed by GtkTreeView.

HTH,
-Torsten

Attachment: SimpleList.patch
Description: Text Data

Attachment: visible.pl
Description: Perl program



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