GtkTreeListRow — A row in a GtkTreeListModel
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 () |
#include <gtk/gtk.h>
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.
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.
self |
The item of this row or NULL
when the row was destroyed.
[nullable][type GObject][transfer full]
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.
self | ||
expanded |
|
gboolean
gtk_tree_list_row_get_expanded (GtkTreeListRow *self
);
Gets if a row is currently expanded.
self |
TRUE
if the row is expanded
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.
self |
TRUE
if the row is expandable
guint
gtk_tree_list_row_get_position (GtkTreeListRow *self
);
Returns the position in the GtkTreeListModel that self
occupies at the moment.
self |
The position in the model
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.
self |
The depth of this row
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.
self |
The model containing the children.
[nullable][transfer none]
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.
self |
The parent of self
.
[nullable][transfer full]
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.
self | ||
position | position of the child to get |
the child in position
.
[nullable][transfer full]
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkTreeListRow.html