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

Syntax

public class NodeStore : GLib.Object, IEnumerable

Remarks

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)
                {
                        this.name = name;
                        this.email = 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", "miguel@ximian.com");
             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]);
     }
  

Requirements

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