gtk-sharp2.12.0.0Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.A store for that provides data from an arbitrary class. It is simpler to use than the .
This class provides a simple mechanism of implementing the Model required by the .
[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 interface, so code can be written like this:
void DumpColumnValues (NodeStore store, int col)
{
foreach (object[] row in store)
Console.WriteLine ("Value of column {0} is {1}", col, row [col]);
}
GLib.ObjectSystem.Collections.IEnumerableMethodSystem.VoidAppends the node to the root level of the tree
a
Adds to the end of the list of root level nodes.
MethodSystem.VoidInserts the node into the root level of the tree
a
the position to insert it at
Adds to the list of root level nodes before the node
currently at .
MethodGtk.ITreeNodeReturns a node given a .
The path to look up.
Looks up the node corresponding to and returns it,
or null if the node cannot be found.
To be added.MethodSystem.VoidRemoves a node from the store.
a
Removes from the list of root level nodes.
ConstructorNodeStore constructor
a
Creates a for nodes of the specified .
The type provided in must implement .
PropertyGLib.GTypeNative type value.a MethodSystem.Collections.IEnumeratorGets an enumerator for the root nodes.a Children of root nodes are not enumerated. You must traverse them independently.MethodSystem.VoidRemoves all nodes from the store.