Re: GtkTreeModel

Hello again!

Christer Palm wrote:
edscott wilson garcia wrote:

Use gtktreestore model. Add a dummy for non expanded directories. That
makes the expander appear. When the user expands, if nothing is in
there, collapse the node and remove the dummy. Since there will be no
children, the expander disappears.

Hmm.. Yeah - that should work I guess. Although it feels a bit backward from an object-oriented point-of-view.

In case anyone is interested, I just want to report that I've implemented Edscotts suggestion, and it works great! Thanks!

I've also explored the row_has_child_toggled() and row_deleted() functions of GtkTreeModel a bit further, and ironically, while GTK immediately calls back on my interface to get the new child and node status when I call these functions, it still messes up and tries to refer to the deleted node as well as complain about inconsistency with the has_child status. At least when I call these from within the iter_children_vfunc() implementation.

Even more surprising is that GTK attempts to dereference the GtkTreeIter iterator returned by my iter_children_vfunc() implementation, even though I have this function return false (and set the GtkTreeIter to an invalid value), as explained in the docs. So this does simply not appear to work correctly [or as documented :-)].

Christer Palm

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