TreeExpander


Object Hierarchy:

Gtk.TreeExpander Gtk.TreeExpander Gtk.TreeExpander Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.TreeExpander GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Gtk.Accessible Gtk.Accessible Gtk.Accessible->Gtk.TreeExpander Gtk.Accessible->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.TreeExpander Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget Gtk.ConstraintTarget Gtk.ConstraintTarget->Gtk.TreeExpander Gtk.ConstraintTarget->Gtk.Widget

Description:

[ CCode ( type_id = "gtk_tree_expander_get_type ()" ) ]
public class TreeExpander : Widget, Accessible, Buildable, ConstraintTarget

`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 [ [email protected]]. `GtkTreeExpander` provides 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 [[email protected]] items which can be set via [ [email protected]_list_row] on the expander. The expander will then watch that row item automatically. [ [email protected]_child] sets the widget that displays the actual row contents.

CSS nodes

``` 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 ` GtkTreeExpander: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.


Namespace: Gtk
Package: gtk4

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object



2022 vala-language.org