[Gtk-sharp-list] Recursive TreeStore?

Wei Weng wweng@kencast.com
Thu, 24 Mar 2005 16:08:48 -0500


Paulo Pires wrote:
> Check Gtk.TreeView. Here follows a simple example
> 
> 
> <snippet>
> 
> TreeView tv = new TreeView ();
> TreeStore store = new TreeStore (typeof (string));
> TreeIter iter;
> 
> int counter, counter2;
> int max = 5;
> 		
> // populate the treeview
> counter = 0;
> while (counter < max)
> {
> 	iter = store.AppendValues ((string) counter);
> 	
> 	counter2 = 0;
> 	while (counter2 < max)
> 	{
> 		store.AppendValues (iter, (string) counter2);
> 		counter2++;
> 	}
> 
> 	counter++;
> }
> 
> tv.Model = store;
> tv.ExpandAll(); // this is optional wether you want to Expand or not the
> TreeView automatically
> 
> </snippet>
> 

Hi. thanks for the reply. But this is not really what I want.
I want at least 3 levels of collaps-able TreeStores.

Right now it looks like

\--0
   \--0
   \--1
\--1
   \--0
   \--1

I want the thing looks like

\--0
   \--0
     \--0
     \--1
   \--1
     \--0
     \--1

Do you know any way to solve my problem? Thanks!

Wei