gtk-sharp 2.12.0.0 Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. GLib.IWrapper The tree interface used by

The interface defines a generic tree interface for use by the widget. It is an abstract interface, and is designed to be usable with any appropriate data structure. The programmer just has to implement this interface on their own data type for it to be viewable by a widget.

The model is represented as a hierarchical tree of strongly-typed, columned data. In other words, the model can be seen as a tree where every node has different values depending on which column is being queried. The types are homogeneous per column across all nodes. It is important to note that this interface only provides a way of examining a model and observing changes. The implementation of each individual model decides how and if changes are made.

In order to make life simpler for programmers who do not need to write their own specialized model, two generic models are provided - the and the . To use these, the developer simply pushes data into these models as necessary. These models provide the data structure as well as all appropriate tree interfaces. As a result, implementing drag and drop, sorting, and storing data is trivial. For the vast majority of trees and lists, these two models are sufficient.

Models are accessed on a node/column level of granularity. One can query for the value of a model at a certain node and a certain column on that node. There are two structures used to reference a particular node in a model. They are the and the . Most of the interface consists of operations on a .

A path is essentially a potential node. It is a location on a model that may or may not actually correspond to a node on a specific model. The struct can be converted into either an array of unsigned integers or a string. The string form is a list of numbers separated by a colon. Each number refers to the offset at that level. Thus, the path "0" refers to the root node and the path "2:4" refers to the fifth child of the third node.

By contrast, a is a reference to a specific node on a specific model. It is a generic struct with an integer and three generic pointers. These are filled in by the model in a model-specific way. One can convert a path to an iterator by calling . These iterators are the primary way of accessing a model and are similar to the iterators used by . The model interface defines a set of operations using them for navigating the model.

It is expected that models fill in the iterator with private data. For example, the model, which is internally a simple linked list, stores a list node in one of the pointers. The stores an array and an offset in two of the pointers. Additionally, there is an integer field. This field is generally filled with a unique stamp per model. This stamp is for catching errors resulting from using invalid iterators with a model.

The lifecycle of an iterator can be a little confusing at first. Iterators are expected to always be valid for as long as the model is unchanged (and does not emit a signal). Additionally, some models guarantee that an iterator is valid for as long as the node it refers to is valid (most notably the and ). Although generally uninteresting, as one always has to allow for the case where iterators do not persist beyond a signal, some very important performance enhancements were made in the sort model. As a result, the flag was added to indicate this behavior.

- Method
  2.12.0.0
  System.Void `` `` an object of type an object of type Emits the signal.
- Method
  2.12.0.0
  System.Void `` an object of type Emits the event. This should be called by models after a row has been removed. The location pointed to by should be the location that the row previously was at. It may not be a valid location anymore.
- Method
  2.12.0.0
  System.Void `` `` an object of type an object of type Emits the event. This should be called by models after the child state of a node changes.
- Method
  2.12.0.0
  System.Void `` `` an object of type , path of the inserted row. an object of type , points to the inserted row. Emits the event.
- Method
  System.Int32 `` `` Sends out a event. a that points to the row whose children have been reordered. a that points to the row whose children have been reordered. a , pointer to an array of integers with the new indices of the children.
- Method
  2.12.0.0
  System.Void `` `` `` To be added. To be added. To be added. To be added. To be added.
- Property
  2.12.0.0
  Gtk.TreeModelFlags Returns a set of flags supported by this interface. an object of type The flags are a bitwise combination of . The flags supported should not change during the lifecycle of the .
- Method
  2.12.0.0
  System.Void `` an object of type Calls on each node in model in a depth-first fashion. If func returns , then the tree ceases to be walked, and this method returns.
- Method
  2.12.0.0
  GLib.GType `` a , the column number. Returns the type of the column at the given index. a
- Method
  2.12.0.0
  System.Boolean `` `` an object of type an object of type Sets to a valid iterator pointing to . an object of type
- Method
  2.12.0.0
  System.Boolean `` an object of type Gets the first iterator in the tree (the one at the path "0") and returns . an object of type Returns if the tree is empty.
- Method
  2.12.0.0
  System.Boolean `` `` an object of type an object of type Gets the at . an object of type Otherwise, is left invalid and is returned.
- Method
  2.12.0.0
  Gtk.TreePath `` an object of type Gets the of . an object of type
- Method
  2.12.0.0
  System.String `` a Generates a string representation of the path of . a This string is a ':' separated list of numbers. For example, "4:10:0:3" would be an acceptable return value for this string.
- Method
  2.12.0.0
  System.Void `` `` an object of type a , pointer to the va_list data structure of arguments (FIXME: clarify what va_lists look like) Gets the values of child properties for the row pointed to by .
- Method
  2.12.0.0
  System.Object `` `` a a Gets the value stored in column of the row pointed to by . a
- Method
  2.12.0.0
  System.Void `` `` `` a a a Gets the value stored in column of the row pointed to by and stores it in
- Method
  2.12.0.0
  System.Boolean `` an object of type Sets the TreeIter object pointed to by to point to the first child of this tree. an object of type , true if the iter has been set to the first child.
- Method
  2.12.0.0
  System.Boolean `` `` an object of type an object of type Sets to point to the first child of . an object of type If has no children, is returned and is set to be invalid. will remain a valid node after this function has been called.
- Method
  2.12.0.0
  System.Boolean `` an object of type Returns if has children, otherwise. an object of type
- Method
  2.12.0.0
  System.Int32 Returns the number of children that the has. an object of type As a special case, if iter is , then the number of toplevel nodes is returned.
- Method
  2.12.0.0
  System.Int32 `` an object of type Returns the number of children that has. an object of type As a special case, if is , then the number of toplevel nodes is returned.
- Method
  2.12.0.0
  System.Boolean `` an object of type Sets to point to the node following it at the current level. an object of type If there is no next iter, is returned and iter is set to be invalid.
- Method
  2.12.0.0
  System.Boolean `` `` an object of type an object of type Sets to be the child of the root node, using the given index. an object of type In this case, the nth root node is set.
- Method
  2.12.0.0
  System.Boolean `` `` `` an object of type an object of type an object of type Sets to be the child of , using the given index. an object of type The first index is 0. If is too big, or has no children, is set to an invalid iterator and is returned. will remain a valid node after this function has been called.
- Method
  2.12.0.0
  System.Boolean `` `` an object of type an object of type Sets to be the parent of . an object of type If is at the toplevel, and does not have a parent, then is set to an invalid iterator and is returned. will remain a valid node after this function has been called.
- Property
  2.12.0.0
  System.Int32 Returns the number of columns supported by the . an object of type
- Method
  2.12.0.0
  System.Void `` an object of type Lets the tree ref the node.

  This is an optional method for models to implement. To be more specific, models may ignore this call as it exists primarily for performance reasons.

  This function is primarily meant as a way for views to let caching models know when nodes are being displayed (and hence, whether or not to cache that node.) For example, a file-system based model would not want to keep the entire file-hierarchy in memory, just the sections that are currently being displayed by every current view.

  A model should be expected to be able to get an iter independent of its referenced state.

- Event
  2.12.0.0
  Gtk.RowChangedHandler Emitted when a row has changed.
- Event
  2.12.0.0
  Gtk.RowDeletedHandler Emitted when a row is deleted.
- Event
  2.12.0.0
  Gtk.RowHasChildToggledHandler Emitted when a child of a row is toggled.
- Event
  2.12.0.0
  Gtk.RowInsertedHandler Emitted when a row has been inserted into the model.
- Event
  2.12.0.0
  Gtk.RowsReorderedHandler Emitted when a row is re-ordered
- Method
  2.12.0.0
  System.Void `` `` `` a a a Sets the value of column in the row pointed to by to if the value is a boolean.
- Method
  2.12.0.0
  System.Void `` `` `` a a a Sets the value of column in the row pointed to by to if the value is a .
- Method
  2.12.0.0
  System.Void `` `` `` a a a Sets the value of column in the row pointed to by to if the value is an .
- Method
  2.12.0.0
  System.Void `` `` `` a a a Sets the value of column in the row pointed to by to if the value is an .
- Method
  2.12.0.0
  System.Void `` `` `` a a a Sets the value of column in the row pointed to by to if the value is an .
- Method
  2.12.0.0
  System.Void `` `` `` a a a Sets the value of column in the row pointed to by to if the value is an .
- Method
  2.12.0.0
  System.Void `` `` `` a a a Sets the value of column in the row pointed to by to if the value is an . To be added.
- Method
  2.12.0.0
  System.Void `` an object of type Lets the tree unref the node. This is an optional method for models to implement. To be more specific, models may ignore this call as it exists primarily for performance reasons. For more information on what this means, see . Please note that nodes that are deleted are not unreferenced.