Top |
Functions
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 () |
Properties
GtkWidget * | child | Read / Write |
GObject * | item | Read |
GtkTreeListRow * | list-row | Read / Write |
Implemented Interfaces
GtkTreeExpander implements GtkAccessible, GtkBuildable and GtkConstraintTarget.
Description
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.
CSS nodes
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.
Accessibility
GtkTreeExpander uses the GTK_ACCESSIBLE_ROLE_GROUP
role. The expander icon
is represented as a GTK_ACCESSIBLE_ROLE_BUTTON
, labelled by the expander's
child, and toggling it will change the GTK_ACCESSIBLE_STATE_EXPANDED
state.
Functions
gtk_tree_expander_get_child ()
GtkWidget *
gtk_tree_expander_get_child (GtkTreeExpander *self
);
Gets the child widget displayed by self
.
gtk_tree_expander_set_child ()
void gtk_tree_expander_set_child (GtkTreeExpander *self
,GtkWidget *child
);
Sets the content widget to display.
gtk_tree_expander_get_item ()
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:
1 |
gtk_tree_list_row_get_item (gtk_tree_expander_get_list_row (@self)); |
gtk_tree_expander_get_list_row ()
GtkTreeListRow *
gtk_tree_expander_get_list_row (GtkTreeExpander *self
);
Gets the list row managed by self
.
gtk_tree_expander_set_list_row ()
void gtk_tree_expander_set_list_row (GtkTreeExpander *self
,GtkTreeListRow *list_row
);
Sets the tree list row that this expander should manage.
Property Details
The “child”
property
“child” GtkWidget *
The child widget with the actual contents
Owner: GtkTreeExpander
Flags: Read / Write
The “item”
property
“item” GObject *
The item held by this expander's row
Owner: GtkTreeExpander
Flags: Read
The “list-row”
property
“list-row” GtkTreeListRow *
The list row to track for expander state
Owner: GtkTreeExpander
Flags: Read / Write