> it describes how to set up a TreeView so that it is bound to an > object containing your data. When the data in your object changes, so > does the TreeView thus allowing you to update the data easily. > My problem is that the example uses a ListModel rather than a > TreeModel as in the previous section > (http://www.mono-project.com/GtkSharp_TreeView_Tutorial#Your_first_TreeView). > If anyone has any examples of how to do this above using a TreeModel I > would greatly appreciate it.
I guess I don't understand the question. Where did you get "ListModel"
from? It isn't anywhere in the provided examples, you attach a
ListStore to a TreeModel, and just have a TreeView with only one
'level'.
Gtk.TreeView tree = new Gtk.TreeView ();
Gtk.ListStore musicListStore = new Gtk.ListStore (typeof (string), typeof
(string));
...
tree.AppendColumn ("Artist", new Gtk.CellRendererText (), "text", 0);
tree.AppendColumn ("Title", new Gtk.CellRendererText (), "text", 1);
musicListStore.AppendValues ("Garbage", "Dog New Tricks");
tree.Model = musicListStore; <-- Model is the the ListStore
ListStore & TreeStore should be able to be used pretty much
interchangeably AFAIK, depending on the need of the application
Admittedly, TreeView is an intimidating beast.
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Gtk-sharp-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
