[Gtk-sharp-list] TreeView, YES!!!

George Farris farrisg@mala.bc.ca
21 Feb 2003 10:02:00 -0800


OK I finally had time to sit down and read the entire gtk document on
treeview, treemodel, treeselection, treepath and treeiter.  It all makes
sense now.  I was reading bits and pieces and thought from code segments
in various pieces of software I could figure it out but..

I have the selection code working great now but there are a few issues. 
One is; there is a discrepancy between current gtk docs and gtk# docs.
Gtk# only targets gtk2.0 while many functions in the gtk docs are geared
toward gtk2.2.  This is a difficult issue because it's not clear that
the there are changes like this from 2.0 to 2.2 on the gtk site.

I realize this stuff is changing rapidly and hope that information like
this is of some help.

Multiple sections of course were as simple as:

book_store.GetIterFirst(ref iter);
if ( book.Selection.IterIsSelected(iter))
{
	book_store.GetValue(iter, 0, value);
	Console.WriteLine("Selection is{0}",(string)value);		
}
			
while (book_store.IterNext(ref iter))
{
	if ( book.Selection.IterIsSelected(iter))
	{
		Value val = new Value ();
		book_store.GetValue(iter, 0, val);
		Console.WriteLine("Selection is {0}", (string)val);
	}

}

I'm somewhat surprised that no one pointed this out a long time ago but
hey, It was a good exercise for me.

Probably what is required is a better document describing how TreeView
and pals actually work.  I could write about what I have experienced but
I certainly don't know the widget that well yet.

Thanks for all pointers and info.
Cheers

-- 
George Farris <farrisg@mala.bc.ca>