Re: Gtk::TreeModel::ColumnsRecord's children
- From: Sergio Perticone <g4ll0ws gmail com>
- To: gtkmm mailing-list <gtkmm-list gnome org>
- Subject: Re: Gtk::TreeModel::ColumnsRecord's children
- Date: Thu, 26 Apr 2007 16:28:08 +0200
Paul Davis wrote:
Sergio,
Do you mean, how do you get to the rows in a TreeStore or ListStore?
Yep.
I think the function you're looking for is Gtk::TreeModel::children()
TreeStore and ListStore both implement this method. The following is a
recusive method to visit all rows in a TreeStore. The linear
ListStore should be a simple case to extract.
Assume _store is a Glib::RefPtr< Gtk::TreeStore > type member variable
of Foo.
void
Foo::go()
{
traverse( _store->children() ) ;
}
void
Foo::traverse( Gtk::TreeModel::Children children )
{
if( children.empty() )
{
return ;
}
Gtk::TreeModel::Children::iterator iter ;
for( iter = children.begin() ; iter != children.end() ; iter++ )
{
traverse( (*iter)->children() ) ;
}
}
Ok, Understood. Thanks a lot!
Paul
s.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]