Re: TreeView path and iter



On 12/18/06, johnmb <johnmblackburn googlemail com> wrote:

I am trying to navigate around a treeview and, to do this, I need a valid
path object.  When I use the following two lines :-

    group_iter = m_refTreeModel->get_iter("0");  // Points to first parent
menu item
    group_path = m_refTreeModel->get_path(group_iter);

I get the following error message :-

Gtk-CRITICAL **: gtk_tree_store_get_path: assertion `iter->user_data !=
NULL' failed

I have tried several variations including :-

    group_path = m_refTreeModel->get_path(m_refTreeModel->get_iter("0"));

but all with the same result - any ideas would be very welcome.


My first instinct is always to use the STL-like interfaces for things
like this if possible, so I rarely deal with the string representation
of paths.  In this case, you could do something like
m_refTreeModel->children().begin(), which would give you the first
iter. Then you could use this iter to get a path if you really need a
path.  I'm not sure if that helps you at all, though.

--
jonner



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