Re: GtkTreeView - how to detect if a row is displayed on the screen?



On Tue, Nov 11, 2003 at 06:27:34PM +0100, Benoit DUMONT wrote:

I don't know how to detect if a row is visible on the screen or not.
When using the deprecated CTree or CList widget, I could use: 
gtk_ctree_node_is_visible but it is now deprecated and I can't find any 
replacement.

You could use TreeView.get_cell_area().  According to the API docs:

http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeView.html#gtk-tree-view-get-cell-area

  If path is NULL, or points to a path not currently displayed, the y and
  height fields of the rectangle will be filled with 0.
  
In other words, if the cell area doesn't overlap the visible area of the
TreeView, these dimensions are just zero.
  
I'm not sure how it works for horizontal scrolling.  Perhaps analogously.

Dave Cook



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