Synopsis
#include <gtk/gtk.h>
GtkTreeModel;
GtkTreeIter;
GtkTreePath;
GtkTreeRowReference;
GtkTreeModelIface;
gboolean (*GtkTreeModelForeachFunc) (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data);
enum GtkTreeModelFlags;
GtkTreePath* gtk_tree_path_new (void);
GtkTreePath* gtk_tree_path_new_from_string (const gchar *path);
GtkTreePath* gtk_tree_path_new_from_indices (gint first_index,
...);
gchar* gtk_tree_path_to_string (GtkTreePath *path);
GtkTreePath* gtk_tree_path_new_first (void);
#define gtk_tree_path_new_root ()
void gtk_tree_path_append_index (GtkTreePath *path,
gint index_);
void gtk_tree_path_prepend_index (GtkTreePath *path,
gint index_);
gint gtk_tree_path_get_depth (GtkTreePath *path);
gint* gtk_tree_path_get_indices (GtkTreePath *path);
void gtk_tree_path_free (GtkTreePath *path);
GtkTreePath* gtk_tree_path_copy (const GtkTreePath *path);
gint gtk_tree_path_compare (const GtkTreePath *a,
const GtkTreePath *b);
void gtk_tree_path_next (GtkTreePath *path);
gboolean gtk_tree_path_prev (GtkTreePath *path);
gboolean gtk_tree_path_up (GtkTreePath *path);
void gtk_tree_path_down (GtkTreePath *path);
gboolean gtk_tree_path_is_ancestor (GtkTreePath *path,
GtkTreePath *descendant);
gboolean gtk_tree_path_is_descendant (GtkTreePath *path,
GtkTreePath *ancestor);
GtkTreeRowReference* gtk_tree_row_reference_new (GtkTreeModel *model,
GtkTreePath *path);
GtkTreeRowReference* gtk_tree_row_reference_new_proxy (GObject *proxy,
GtkTreeModel *model,
GtkTreePath *path);
GtkTreeModel* gtk_tree_row_reference_get_model (GtkTreeRowReference *reference);
GtkTreePath* gtk_tree_row_reference_get_path (GtkTreeRowReference *reference);
gboolean gtk_tree_row_reference_valid (GtkTreeRowReference *reference);
void gtk_tree_row_reference_free (GtkTreeRowReference *reference);
GtkTreeRowReference* gtk_tree_row_reference_copy (GtkTreeRowReference *reference);
void gtk_tree_row_reference_inserted (GObject *proxy,
GtkTreePath *path);
void gtk_tree_row_reference_deleted (GObject *proxy,
GtkTreePath *path);
void gtk_tree_row_reference_reordered (GObject *proxy,
GtkTreePath *path,
GtkTreeIter *iter,
gint *new_order);
GtkTreeIter* gtk_tree_iter_copy (GtkTreeIter *iter);
void gtk_tree_iter_free (GtkTreeIter *iter);
GtkTreeModelFlags gtk_tree_model_get_flags (GtkTreeModel *tree_model);
gint gtk_tree_model_get_n_columns (GtkTreeModel *tree_model);
GType gtk_tree_model_get_column_type (GtkTreeModel *tree_model,
gint index_);
gboolean gtk_tree_model_get_iter (GtkTreeModel *tree_model,
GtkTreeIter *iter,
GtkTreePath *path);
gboolean gtk_tree_model_get_iter_from_string (GtkTreeModel *tree_model,
GtkTreeIter *iter,
const gchar *path_string);
gboolean gtk_tree_model_get_iter_first (GtkTreeModel *tree_model,
GtkTreeIter *iter);
#define gtk_tree_model_get_iter_root (tree_model, iter)
GtkTreePath* gtk_tree_model_get_path (GtkTreeModel *tree_model,
GtkTreeIter *iter);
void gtk_tree_model_get_value (GtkTreeModel *tree_model,
GtkTreeIter *iter,
gint column,
GValue *value);
gboolean gtk_tree_model_iter_next (GtkTreeModel *tree_model,
GtkTreeIter *iter);
gboolean gtk_tree_model_iter_children (GtkTreeModel *tree_model,
GtkTreeIter *iter,
GtkTreeIter *parent);
gboolean gtk_tree_model_iter_has_child (GtkTreeModel *tree_model,
GtkTreeIter *iter);
gint gtk_tree_model_iter_n_children (GtkTreeModel *tree_model,
GtkTreeIter *iter);
gboolean gtk_tree_model_iter_nth_child (GtkTreeModel *tree_model,
GtkTreeIter *iter,
GtkTreeIter *parent,
gint n);
gboolean gtk_tree_model_iter_parent (GtkTreeModel *tree_model,
GtkTreeIter *iter,
GtkTreeIter *child);
gchar* gtk_tree_model_get_string_from_iter (GtkTreeModel *tree_model,
GtkTreeIter *iter);
void gtk_tree_model_ref_node (GtkTreeModel *tree_model,
GtkTreeIter *iter);
void gtk_tree_model_unref_node (GtkTreeModel *tree_model,
GtkTreeIter *iter);
void gtk_tree_model_get (GtkTreeModel *tree_model,
GtkTreeIter *iter,
...);
void gtk_tree_model_get_valist (GtkTreeModel *tree_model,
GtkTreeIter *iter,
va_list var_args);
void gtk_tree_model_foreach (GtkTreeModel *model,
GtkTreeModelForeachFunc func,
gpointer user_data);
void gtk_tree_model_row_changed (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void gtk_tree_model_row_inserted (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void gtk_tree_model_row_has_child_toggled
(GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void gtk_tree_model_row_deleted (GtkTreeModel *tree_model,
GtkTreePath *path);
void gtk_tree_model_rows_reordered (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter,
gint *new_order);
Known ImplementationsGtkTreeModel is implemented by GtkTreeModelFilter, GtkTreeModelSort, GtkTreeStore and GtkListStore. Signals"row-changed" : Run Last "row-deleted" : Run First "row-has-child-toggled" : Run Last "row-inserted" : Run First "rows-reordered" : Run First DescriptionThe GtkTreeModel interface defines a generic tree interface for use by the GtkTreeView 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 GtkTreeView 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 type of data found in a column is determined by using the GType system (ie. G_TYPE_INT, GTK_TYPE_BUTTON, G_TYPE_POINTER, etc.). 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 GtkTreeStore and the GtkListStore. 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 GtkTreePath and the GtkTreeIter [4] Most of the interface consists of operations on a GtkTreeIter. 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 GtkTreePath 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 GtkTreeIter 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
It is expected that models fill in the iterator with private data. For example, the GtkListStore model, which is internally a simple linked list, stores a list node in one of the pointers. The GtkTreeModelSort 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 doesn't emit a signal). The model is considered to own all outstanding iterators and nothing needs to be done to free them from the user's point of view. Additionally, some models guarantee that an iterator is valid for as long as the node it refers to is valid (most notably the GtkTreeStore and GtkListStore). 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 GTK_TREE_MODEL_ITERS_PERSIST flag was added to indicate this behavior. To help show some common operation of a model, some examples are provided. The first example shows three ways of getting the iter at the location “3:2:5”. While the first method shown is easier, the second is much more common, as you often get paths from callbacks.
Example 17. Acquiring a GtkTreeIter
/* Three ways of getting the iter pointing to the location
*/
{
GtkTreePath *path;
GtkTreeIter iter;
GtkTreeIter parent_iter;
/* get the iterator from a string */
gtk_tree_model_get_iter_from_string (model, &iter, "3:2:5");
/* get the iterator from a path */
path = gtk_tree_path_new_from_string ("3:2:5");
gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_path_free (path);
/* walk the tree to find the iterator */
gtk_tree_model_iter_nth_child (model, &iter, NULL, 3);
parent_iter = iter;
gtk_tree_model_iter_nth_child (model, &iter, &parent_iter, 2);
parent_iter = iter;
gtk_tree_model_iter_nth_child (model, &iter, &parent_iter, 5);
}
This second example shows a quick way of iterating through a list and
getting a string and an integer from each row. The
Example 18. Reading data from a GtkTreeModel
enum
{
STRING_COLUMN,
INT_COLUMN,
N_COLUMNS
};
{
GtkTreeModel *list_store;
GtkTreeIter iter;
gboolean valid;
gint row_count = 0;
/* make a new list_store */
list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_INT);
/* Fill the list store with data */
populate_model (list_store);
/* Get the first iter in the list */
valid = gtk_tree_model_get_iter_first (list_store, &iter);
while (valid)
{
/* Walk through the list, reading each row */
gchar *str_data;
gint int_data;
/* Make sure you terminate calls to gtk_tree_model_get()
* with a '-1' value
*/
gtk_tree_model_get (list_store, &iter,
STRING_COLUMN, &str_data,
INT_COLUMN, &int_data,
-1);
/* Do something with the data */
g_print ("Row %d: (%s,%d)\n", row_count, str_data, int_data);
g_free (str_data);
row_count ++;
valid = gtk_tree_model_iter_next (list_store, &iter);
}
}
DetailsGtkTreeItertypedef struct {
gint stamp;
gpointer user_data;
gpointer user_data2;
gpointer user_data3;
} GtkTreeIter;
The GtkTreeIter is the primary structure for
accessing a structure. Models are expected to put a unique integer in
the
GtkTreeModelIfacetypedef struct {
GTypeInterface g_iface;
/* Signals */
void (* row_changed) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* row_inserted) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* row_has_child_toggled) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
void (* row_deleted) (GtkTreeModel *tree_model,
GtkTreePath *path);
void (* rows_reordered) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter,
gint *new_order);
/* Virtual Table */
GtkTreeModelFlags (* get_flags) (GtkTreeModel *tree_model);
gint (* get_n_columns) (GtkTreeModel *tree_model);
GType (* get_column_type) (GtkTreeModel *tree_model,
gint index_);
gboolean (* get_iter) (GtkTreeModel *tree_model,
GtkTreeIter *iter,
GtkTreePath *path);
GtkTreePath *(* get_path) (GtkTreeModel *tree_model,
GtkTreeIter *iter);
void (* get_value) (GtkTreeModel *tree_model,
GtkTreeIter *iter,
gint column,
GValue *value);
gboolean (* iter_next) (GtkTreeModel *tree_model,
GtkTreeIter *iter);
gboolean (* iter_children) (GtkTreeModel *tree_model,
GtkTreeIter *iter,
GtkTreeIter *parent);
gboolean (* iter_has_child) (GtkTreeModel *tree_model,
GtkTreeIter *iter);
gint (* iter_n_children) (GtkTreeModel *tree_model,
GtkTreeIter *iter);
gboolean (* iter_nth_child) (GtkTreeModel *tree_model,
GtkTreeIter *iter,
GtkTreeIter *parent,
gint n);
gboolean (* iter_parent) (GtkTreeModel *tree_model,
GtkTreeIter *iter,
GtkTreeIter *child);
void (* ref_node) (GtkTreeModel *tree_model,
GtkTreeIter *iter);
void (* unref_node) (GtkTreeModel *tree_model,
GtkTreeIter *iter);
} GtkTreeModelIface;
GtkTreeModelForeachFunc ()gboolean (*GtkTreeModelForeachFunc) (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data);
enum GtkTreeModelFlagstypedef enum
{
GTK_TREE_MODEL_ITERS_PERSIST = 1 << 0,
GTK_TREE_MODEL_LIST_ONLY = 1 << 1
} GtkTreeModelFlags;
These flags indicate various properties of a GtkTreeModel. They are
returned by gtk_tree_path_new ()GtkTreePath* gtk_tree_path_new (void); Creates a new GtkTreePath. This structure refers to a row.
gtk_tree_path_new_from_string ()GtkTreePath* gtk_tree_path_new_from_string (const gchar *path);
Creates a new GtkTreePath initialized to
gtk_tree_path_new_from_indices ()GtkTreePath* gtk_tree_path_new_from_indices (gint first_index, ...);
Creates a new path with
Since 2.2 gtk_tree_path_to_string ()gchar* gtk_tree_path_to_string (GtkTreePath *path); Generates a string representation of the path. This string is a ':' separated list of numbers. For example, "4:10:0:3" would be an acceptable return value for this string.
gtk_tree_path_new_first ()GtkTreePath* gtk_tree_path_new_first (void); Creates a new GtkTreePath. The string representation of this path is "0"
gtk_tree_path_new_root()#define gtk_tree_path_new_root() gtk_tree_path_new_first() Warning
An alternate name for
gtk_tree_path_append_index ()void gtk_tree_path_append_index (GtkTreePath *path, gint index_); Appends a new index to a path. As a result, the depth of the path is increased.
gtk_tree_path_prepend_index ()void gtk_tree_path_prepend_index (GtkTreePath *path, gint index_); Prepends a new index to a path. As a result, the depth of the path is increased.
gtk_tree_path_get_depth ()gint gtk_tree_path_get_depth (GtkTreePath *path);
Returns the current depth of
gtk_tree_path_get_indices ()gint* gtk_tree_path_get_indices (GtkTreePath *path);
Returns the current indices of
gtk_tree_path_free ()void gtk_tree_path_free (GtkTreePath *path);
Frees
gtk_tree_path_copy ()GtkTreePath* gtk_tree_path_copy (const GtkTreePath *path);
Creates a new GtkTreePath as a copy of
gtk_tree_path_compare ()gint gtk_tree_path_compare (const GtkTreePath *a, const GtkTreePath *b);
Compares two paths. If
gtk_tree_path_next ()void gtk_tree_path_next (GtkTreePath *path);
Moves the
gtk_tree_path_prev ()gboolean gtk_tree_path_prev (GtkTreePath *path);
Moves the
gtk_tree_path_up ()gboolean gtk_tree_path_up (GtkTreePath *path);
Moves the
gtk_tree_path_down ()void gtk_tree_path_down (GtkTreePath *path);
Moves
gtk_tree_path_is_ancestor ()gboolean gtk_tree_path_is_ancestor (GtkTreePath *path, GtkTreePath *descendant);
Returns
gtk_tree_path_is_descendant ()gboolean gtk_tree_path_is_descendant (GtkTreePath *path, GtkTreePath *ancestor);
Returns
gtk_tree_row_reference_new ()GtkTreeRowReference* gtk_tree_row_reference_new (GtkTreeModel *model, GtkTreePath *path);
Creates a row reference based on
gtk_tree_row_reference_new_proxy ()GtkTreeRowReference* gtk_tree_row_reference_new_proxy (GObject *proxy, GtkTreeModel *model, GtkTreePath *path);
You do not need to use this function. Creates a row reference based on
These functions must be called exactly once per proxy when the
corresponding signal on the model is emitted. This single call
updates all row references for that proxy. Since built-in GTK+
objects like GtkTreeView already use this mechanism internally,
using them as the proxy object will produce unpredictable results.
Further more, passing the same object as This type of row reference is primarily meant by structures that need to carefully monitor exactly when a row reference updates itself, and is not generally needed by most applications.
gtk_tree_row_reference_get_model ()GtkTreeModel* gtk_tree_row_reference_get_model (GtkTreeRowReference *reference); Returns the model that the row reference is monitoring.
Since 2.8 gtk_tree_row_reference_get_path ()GtkTreePath* gtk_tree_row_reference_get_path (GtkTreeRowReference *reference);
Returns a path that the row reference currently points to, or
gtk_tree_row_reference_valid ()gboolean gtk_tree_row_reference_valid (GtkTreeRowReference *reference);
Returns
gtk_tree_row_reference_free ()void gtk_tree_row_reference_free (GtkTreeRowReference *reference);
Free's
gtk_tree_row_reference_copy ()GtkTreeRowReference* gtk_tree_row_reference_copy (GtkTreeRowReference *reference); Copies a GtkTreeRowReference.
Since 2.2 gtk_tree_row_reference_inserted ()void gtk_tree_row_reference_inserted (GObject *proxy,
GtkTreePath *path);
Lets a set of row reference created by
gtk_tree_row_reference_deleted ()void gtk_tree_row_reference_deleted (GObject *proxy,
GtkTreePath *path);
Lets a set of row reference created by
gtk_tree_row_reference_reordered ()void gtk_tree_row_reference_reordered (GObject *proxy,
GtkTreePath *path,
GtkTreeIter *iter,
gint *new_order);
Lets a set of row reference created by
gtk_tree_iter_copy ()GtkTreeIter* gtk_tree_iter_copy (GtkTreeIter *iter);
Creates a dynamically allocated tree iterator as a copy of
gtk_tree_iter_free ()void gtk_tree_iter_free (GtkTreeIter *iter);
Frees an iterator that has been allocated by
gtk_tree_model_get_flags ()GtkTreeModelFlags gtk_tree_model_get_flags (GtkTreeModel *tree_model);
Returns a set of flags supported by this interface. The flags are a bitwise
combination of GtkTreeModelFlags. The flags supported should not change
during the lifecycle of the
gtk_tree_model_get_n_columns ()gint gtk_tree_model_get_n_columns (GtkTreeModel *tree_model);
Returns the number of columns supported by
gtk_tree_model_get_column_type ()GType gtk_tree_model_get_column_type (GtkTreeModel *tree_model, gint index_); Returns the type of the column.
gtk_tree_model_get_iter ()gboolean gtk_tree_model_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path);
Sets
gtk_tree_model_get_iter_from_string ()gboolean gtk_tree_model_get_iter_from_string (GtkTreeModel *tree_model, GtkTreeIter *iter, const gchar *path_string);
Sets
gtk_tree_model_get_iter_first ()gboolean gtk_tree_model_get_iter_first (GtkTreeModel *tree_model, GtkTreeIter *iter);
Initializes
gtk_tree_model_get_iter_root()#define gtk_tree_model_get_iter_root(tree_model, iter) gtk_tree_model_get_iter_first(tree_model, iter) Warning
A alternate name for
gtk_tree_model_get_path ()GtkTreePath* gtk_tree_model_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter);
Returns a newly-created GtkTreePath referenced by
gtk_tree_model_get_value ()void gtk_tree_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint column, GValue *value);
Sets initializes and sets
gtk_tree_model_iter_next ()gboolean gtk_tree_model_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter);
Sets
gtk_tree_model_iter_children ()gboolean gtk_tree_model_iter_children (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent);
Sets
If
gtk_tree_model_iter_has_child ()gboolean gtk_tree_model_iter_has_child (GtkTreeModel *tree_model, GtkTreeIter *iter);
Returns
gtk_tree_model_iter_n_children ()gint gtk_tree_model_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *iter);
Returns the number of children that
gtk_tree_model_iter_nth_child ()gboolean gtk_tree_model_iter_nth_child (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent, gint n);
Sets
gtk_tree_model_iter_parent ()gboolean gtk_tree_model_iter_parent (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *child);
Sets
gtk_tree_model_get_string_from_iter ()gchar* gtk_tree_model_get_string_from_iter (GtkTreeModel *tree_model, GtkTreeIter *iter); Generates a string representation of the iter. This string is a ':' separated list of numbers. For example, "4:10:0:3" would be an acceptable return value for this string.
Since 2.2 gtk_tree_model_ref_node ()void gtk_tree_model_ref_node (GtkTreeModel *tree_model, GtkTreeIter *iter); 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 model 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 reffed state.
gtk_tree_model_unref_node ()void gtk_tree_model_unref_node (GtkTreeModel *tree_model, GtkTreeIter *iter); 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
gtk_tree_model_get ()void gtk_tree_model_get (GtkTreeModel *tree_model, GtkTreeIter *iter, ...);
Gets the value of one or more cells in the row referenced by
gtk_tree_model_get_valist ()void gtk_tree_model_get_valist (GtkTreeModel *tree_model, GtkTreeIter *iter, va_list var_args);
See
gtk_tree_model_foreach ()void gtk_tree_model_foreach (GtkTreeModel *model, GtkTreeModelForeachFunc func, gpointer user_data);
Calls func on each node in model in a depth-first fashion.
If
gtk_tree_model_row_changed ()void gtk_tree_model_row_changed (GtkTreeModel *tree_model, GtkTreePath *path, GtkTreeIter *iter);
Emits the "row-changed" signal on
gtk_tree_model_row_inserted ()void gtk_tree_model_row_inserted (GtkTreeModel *tree_model, GtkTreePath *path, GtkTreeIter *iter);
Emits the "row-inserted" signal on
gtk_tree_model_row_has_child_toggled ()void gtk_tree_model_row_has_child_toggled
(GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter);
Emits the "row-has-child-toggled" signal on
gtk_tree_model_row_deleted ()void gtk_tree_model_row_deleted (GtkTreeModel *tree_model, GtkTreePath *path);
Emits the "row-deleted" signal on
gtk_tree_model_rows_reordered ()void gtk_tree_model_rows_reordered (GtkTreeModel *tree_model, GtkTreePath *path, GtkTreeIter *iter, gint *new_order);
Emits the "rows-reordered" signal on
Signal DetailsThe
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
the GtkTreeModel on which the signal is emitted |
|
a GtkTreePath identifying the changed row |
|
a valid GtkTreeIter pointing to the changed row |
|
user data set when the signal handler was connected. |
"row-deleted" signalvoid user_function (GtkTreeModel *tree_model, GtkTreePath *path, gpointer user_data) : Run First
This signal is emitted when a row has been deleted.
Note that no iterator is passed to the signal handler, since the row is already deleted.
Implementations of GtkTreeModel must emit row-deleted before removing the node from its internal data structures. This is because models and views which access and monitor this model might have references on the node which need to be released in the row-deleted handler.
|
the GtkTreeModel on which the signal is emitted |
|
a GtkTreePath identifying the row |
|
user data set when the signal handler was connected. |
"row-has-child-toggled" signalvoid user_function (GtkTreeModel *tree_model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data) : Run Last
This signal is emitted when a row has gotten the first child row or lost its last child row.
|
the GtkTreeModel on which the signal is emitted |
|
a GtkTreePath identifying the row |
|
a valid GtkTreeIter pointing to the row |
|
user data set when the signal handler was connected. |
"row-inserted" signalvoid user_function (GtkTreeModel *tree_model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data) : Run First
This signal is emitted when a new row has been inserted in the model.
Note that the row may still be empty at this point, since it is a common pattern to first insert an empty row, and then fill it with the desired values.
|
the GtkTreeModel on which the signal is emitted |
|
a GtkTreePath identifying the new row |
|
a valid GtkTreeIter pointing to the new row |
|
user data set when the signal handler was connected. |
"rows-reordered" signalvoid user_function (GtkTreeModel *tree_model, GtkTreePath *path, GtkTreeIter *iter, gpointer arg3, gpointer user_data) : Run First
This signal is emitted when the children of a node in the GtkTreeModel have been reordered.
Note that this signal is not emitted when rows are reordered by DND, since this is implemented by removing and then reinserting the row.
|
the GtkTreeModel on which the signal is emitted |
|
a GtkTreePath identifying the tree node whose children have been reordered |
|
a valid GtkTreeIter pointing to the node whose |
|
user data set when the signal handler was connected. |