Re: Notification of row expansion and row collapsed in GtkTreeView



Thomas Broyer <tbroyer ltgt net> writes:

> Le 11/06/01 12:44:21, Padraig O'Briain a écrit :
> > I am trying to obtain notification of when a row in a GtkTreeView is
> > expanded or collapsed. I have found the signals "expand_row" and
> > "collapse_row".
> > 
> > However, it seems to me that these signals are emitted before the row is 
> > actually expanded or collapsed. Is there a reason why this signal could
> > not be emitted after the actual expansion or collapse?
> 
> Imagine a tree view of a file system. You'll use empty children for each
> directory to make them having an expander arrow. When the row is expanded,
> you remove the empty child, scan the directory, and insert children for
> each file and directory in it.
> You need to receive the signal before the actual expansion.

Actually, with a custom model, there's a has_children method that
doesn't actually look at the children.  This way you can let the tree
know that there are children prior to reading the child directory.
This is useful in the /afs case of a filemanager... (-:


> > If I want to be notified after the actual expansion, do I need a new
> > signals in GtkTreeView or can I call gtk_idle_add() in the signal
> > handler for say, expand_row, to ensure that the row is actually expanded?
> 
> Maybe there is a solution using expose events...

Ugh.  I'd rather add a row_expanded/row_collapsed signal then have
people try to do such things.

Thanks,
-Jonathan




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