Gtk.NodeStore Class
A store for Gtk.TreeView that provides data from an arbitrary class. It is simpler to use than the Gtk.ListStore.

See Also: NodeStore Members


public class NodeStore : GLib.Object, IEnumerable


This class provides a simple mechanism of implementing the Model required by the Gtk.TreeView.

C# Example

     [TreeNode (ColumnCount=2)]
     class DemoNode {
                string name;
                string email;

                public DemoNode (string name, string email)
               = name;
               = email;

                [TreeNodeValue (Column=0)]
                public string Name {
                        get { return name; }

                [TreeNodeValue (Column=1)]
                public string EMail {
                        get { return email; }

     class Demo {
         NodeStore store;

         void PopulateStore ()
             NodeStore store = new NodeStore (typeof (DemoNode));
             DemoNode my_node = new DemoNode ("Miguel de Icaza", "");
             store.AddNode (my_node);

Iteration: In new versions of Gtk# (2.0 and up) this class implements the IEnumerable interface, so code can be written like this:

C# Example

     void DumpColumnValues (NodeStore store, int col)
         foreach (object[] row in store) 
              Console.WriteLine ("Value of column {0} is {1}", col, row [col]);


Namespace: Gtk
Assembly: gtk-sharp (in gtk-sharp.dll)
Assembly Versions: