Re: dumping an entire treeview into a HoH



On Thu, 2008-12-25 at 08:15 -0500, zentara wrote:
Hi,

I'm hoping someone can save me some hacking by showing me
a generic code snippet for walking an entire tree and getting
all it's values.

there is no generic code because a TreeModel is a generic data
structure, of which only you know the contents because you created it in
the first place.

use the ::foreach() method of Gtk2::TreeModel.

Is this possible? Or is it better to create a data structure first,
then populate the tree from the data structure?

it's usually a bad idea to replicate data across from data structures;
the good idea is to create your data structure as a Glib::Object
subclass and implement the Gtk2::TreeModel interface on it, so you can
use it directly to populate a TreeView.

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net




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