RE: [gtkmm] iterating through the contents of a tree



Murray Cumming
www.murrayc.com
murrayc usa net

> -----Original Message-----
> From: gtkmm-list-admin gnome org 
> [mailto:gtkmm-list-admin gnome org] On Behalf Of Bevis Peters
> Sent: Mittwoch, 7. Januar 2004 13:55
> To: gtkmm-list gnome org
> Subject: [gtkmm] iterating through the contents of a tree
> 
> 
> I've searched the archives and the web and the gktmm class lists, but 
> can't find out how to do this.
> 
> I have a Gtk::TreeView with a Gtk::TreeStore, basically following the 
> tree view example from the gtkmm pages.  My 
> Gtk::TreeModel::ColumnRecord 
> contains two strings (one hidden).  I can multi select 
> entries on the tree.
> 
> Now I want to iterate through all the entries selected in my 
> tree when a 
> button is pressed, ie something like:
> 
> for (Gtk::TreeIter it=m_refTreeModel.begin(); 
> it<m_refTreeModel.end(); 
> ++it) {
>     string str = m_Colmuns[it].m_string_name;
> }
> 
> Can this be done?  surely it can, though I can't work out how.

How to iterate over rows:
http://www.gtkmm.org/gtkmm2/docs/tutorial/html/ch08s03.html

Get column values from cells:
http://www.gtkmm.org/gtkmm2/docs/tutorial/html/ch08.html#id2878009

Setting column values in cells:
http://www.gtkmm.org/gtkmm2/docs/tutorial/html/ch08.html#id2877986

Should help.

Murray Cumming
www.murrayc.com
murrayc usa net 



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