Re: Documentation Request



Murray Cumming wrote:
On Mon, 2005-03-21 at 13:30 -0600, Bob Caryl wrote:
What I need to do is: When a row is selected (and probably when the state of the check box is toggled) I need to determine the ancestor of the current row if it has one. I then need to determine if any of its children's checkboxes are "activated" and then activate the ancestor's check box, proceeding recursively up the treestore until I hit the top level.

Gtk::TreeModel::iterator::parent() and
Gtk::TreeModel::iterator::children() should let you navigate up and
down.

So, what I am struggling with now is deriving my own version of Gtk::TreeModel

Whoah there. It's extremely unlikely that you want to do that just to
find out about some child rows. And you are not ready for such an
advanced technique.

You seem very confused about the TreeView. You really should read the
book chapter before guessing at stuff from the API:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/ch08.html


The reason I was deriving my own Gtk:TreeModel class came from the following from your docs:

virtual bool Gtk::TreeModel::iter_parent_vfunc ( const iterator& child, iterator& iter)

Override and implement this in a derived TreeModel <http://www.musics.com/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1TreeModel.html> class.

Sets /iter/ to be the parent of /child/. If /child/ is at the toplevel, and doesn't have a parent, then /iter/ is set to an invalid iterator and false is returned.

Parameters:
            child An iterator
iter An iterator that will refer to the parent node, or will be set as invalid
Returns:
            true if the operation was possible.

I can fully appreciate the magnitude of a project like gtkmm, but rest assured very few of us out here are mind readers. Absent documentation it is rather difficult to use the certain parts of the API. So far, I have found documentation on functions that will, given two iterators, tell me whether or not one is the ancestor of another, along with the documentation concerning functions that allow me to iterate over the children elements of a particular parent. Now, if I can lay my hands on the documentation for the call to Gtk::TreeModel::iterator::parent() I will be in tall cotton.


Thanks,
Bob Caryl



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