Re: TreeView path and iter
- From: "Paul Davis" <pjdavis engineering uiowa edu>
- To: johnmb <johnmblackburn googlemail com>
- Cc: gtkmm-list gnome org
- Subject: Re: TreeView path and iter
- Date: Mon, 18 Dec 2006 11:25:14 -0600
John,
Not exactly sure about the functions you listed, but this is a simple
recursive function to find a given row.
bool
CellEventsModule::FindRow( int parent, Gtk::TreeModel::Children
children, Gtk::TreeModel::Row& row )
{
if( children.empty() )
{
return false ;
}
Gtk::TreeModel::Children::iterator iter ;
iter = children.begin() ;
while( iter != children.end() )
{
if( (*iter)[ _event_columns.id ] == parent )
{
row = (*iter) ;
return true ;
}
if( FindRow( parent, (*iter).children(), row ) )
{
return true ;
}
iter++ ;
}
return false ;
}
Its not the best, but it should get the idea acroos.
Paul
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.
Thanks
John
--
View this message in context: http://www.nabble.com/TreeView-path-and-iter-tf2839301.html#a7927173
Sent from the Gtkmm mailing list archive at Nabble.com.
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]