Top | ![]() |
![]() |
![]() |
![]() |
GtkWidget * | gtk_tree_expander_new () |
GtkWidget * | gtk_tree_expander_get_child () |
void | gtk_tree_expander_set_child () |
gpointer | gtk_tree_expander_get_item () |
GtkTreeListRow * | gtk_tree_expander_get_list_row () |
void | gtk_tree_expander_set_list_row () |
GtkWidget * | child | Read / Write |
GObject * | item | Read |
GtkTreeListRow * | list-row | Read / Write |
GtkTreeExpander implements GtkAccessible, GtkBuildable and GtkConstraintTarget.
GtkTreeExpander is a widget that provides an expander for a list.
It is typically placed as a bottommost child into a GtkListView to allow users to expand and collapse children in a list with a GtkTreeListModel. It will provide the common UI elements, gestures and keybindings for this purpose.
On top of this, the "listitem.expand", "listitem.collapse" and "listitem.toggle-expand" actions are provided to allow adding custom UI for managing expanded state.
The GtkTreeListModel must be set to not be passthrough. Then it will provide
GtkTreeListRow items which can be set via gtk_tree_expander_set_list_row()
on the expander. The expander will then watch that row item automatically.
gtk_tree_expander_set_child()
sets the widget that displays the actual row
contents.
1 2 3 4 |
treeexpander ├── [indent]* ├── [expander] ╰── <child> |
GtkTreeExpander has zero or one CSS nodes with the name "expander" that should
display the expander icon. The node will be :checked
when it is expanded.
If the node is not expandable, an "indent" node will be displayed instead.
For every level of depth, another "indent" node is prepended.
GtkWidget *
gtk_tree_expander_get_child (GtkTreeExpander *self
);
Gets the child widget displayed by self
.
void gtk_tree_expander_set_child (GtkTreeExpander *self
,GtkWidget *child
);
Sets the content widget to display.
gpointer
gtk_tree_expander_get_item (GtkTreeExpander *self
);
Forwards the item set on the GtkTreeListRow that self
is managing.
This call is essentially equivalent to calling
gtk_tree_list_row_get_item (gtk_tree_expander_get_list_row (@self))
.
GtkTreeListRow *
gtk_tree_expander_get_list_row (GtkTreeExpander *self
);
Gets the list row managed by self
.
void gtk_tree_expander_set_list_row (GtkTreeExpander *self
,GtkTreeListRow *list_row
);
Sets the tree list row that this expander should manage.
“child”
property“child” GtkWidget *
The child widget with the actual contents
Owner: GtkTreeExpander
Flags: Read / Write
“item”
property “item” GObject *
The item held by this expander's row
Owner: GtkTreeExpander
Flags: Read
“list-row”
property“list-row” GtkTreeListRow *
The list row to track for expander state
Owner: GtkTreeExpander
Flags: Read / Write