Top |
Functions
gpointer | gtk_tree_list_row_get_item () |
void | gtk_tree_list_row_set_expanded () |
gboolean | gtk_tree_list_row_get_expanded () |
gboolean | gtk_tree_list_row_is_expandable () |
guint | gtk_tree_list_row_get_position () |
guint | gtk_tree_list_row_get_depth () |
GListModel * | gtk_tree_list_row_get_children () |
GtkTreeListRow * | gtk_tree_list_row_get_parent () |
GtkTreeListRow * | gtk_tree_list_row_get_child_row () |
Description
GtkTreeListRow is the object used by GtkTreeListModel to represent items. It allows navigating the model as a tree and modify the state of rows.
GtkTreeListRow instances are created by a GtkTreeListModel only when the “passthrough” property is not set.
There are various support objects that can make use of GtkTreeListRow objects, such as the GtkTreeExpander widget that allows displaying an icon to expand or collapse a row or GtkTreeListRowSorter that makes it possible to sort trees properly.
Functions
gtk_tree_list_row_get_item ()
gpointer
gtk_tree_list_row_get_item (GtkTreeListRow *self
);
Gets the item corresponding to this row,
The value returned by this function never changes until the row is destroyed.
gtk_tree_list_row_set_expanded ()
void gtk_tree_list_row_set_expanded (GtkTreeListRow *self
,gboolean expanded
);
Expands or collapses a row.
If a row is expanded, the model of calling the GtkTreeListModelCreateModelFunc for the row's item will be inserted after this row. If a row is collapsed, those items will be removed from the model.
If the row is not expandable, this function does nothing.
gtk_tree_list_row_get_expanded ()
gboolean
gtk_tree_list_row_get_expanded (GtkTreeListRow *self
);
Gets if a row is currently expanded.
gtk_tree_list_row_is_expandable ()
gboolean
gtk_tree_list_row_is_expandable (GtkTreeListRow *self
);
Checks if a row can be expanded. This does not mean that the
row is actually expanded, this can be checked with
gtk_tree_list_row_get_expanded()
If a row is expandable never changes until the row is destroyed.
gtk_tree_list_row_get_position ()
guint
gtk_tree_list_row_get_position (GtkTreeListRow *self
);
Returns the position in the GtkTreeListModel that self
occupies
at the moment.
gtk_tree_list_row_get_depth ()
guint
gtk_tree_list_row_get_depth (GtkTreeListRow *self
);
Gets the depth of this row. Rows that correspond to items in the root model have a depth of zero, rows corresponding to items of models of direct children of the root model have a depth of 1 and so on.
The depth of a row never changes until the row is destroyed.
gtk_tree_list_row_get_children ()
GListModel *
gtk_tree_list_row_get_children (GtkTreeListRow *self
);
If the row is expanded, gets the model holding the children of self
.
This model is the model created by the GtkTreeListModelCreateModelFunc and contains the original items, no matter what value “passthrough” is set to.
gtk_tree_list_row_get_parent ()
GtkTreeListRow *
gtk_tree_list_row_get_parent (GtkTreeListRow *self
);
Gets the row representing the parent for self
. That is the row that would
need to be collapsed to make this row disappear.
If self
is a row corresponding to the root model, NULL
is returned.
The value returned by this function never changes until the row is destroyed.
gtk_tree_list_row_get_child_row ()
GtkTreeListRow * gtk_tree_list_row_get_child_row (GtkTreeListRow *self
,guint position
);
If self
is not expanded or position
is greater than the number of
children, NULL
is returned.