TreeExpander
open class TreeExpander : Widget, TreeExpanderProtocol
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
[classGtk.TreeListModel]. 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 [classGtk.TreeListRow] items which can be set via
[methodGtk.TreeExpander.set_list_row] on the expander.
The expander will then watch that row item automatically.
[methodGtk.TreeExpander.set_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 :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.
The TreeExpander type acts as a reference-counted owner of an underlying GtkTreeExpander instance.
It provides the methods that can operate on this data type through TreeExpanderProtocol conformance.
Use TreeExpander as a strong reference or owner of a GtkTreeExpander instance.
-
Designated initialiser from the underlying `C` data type.This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the
TreeExpanderinstance.Declaration
Swift
@inlinable public init(_ op: UnsafeMutablePointer<GtkTreeExpander>)Parameters
oppointer to the underlying object
-
Designated initialiser from a constant pointer to the underlying
Cdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theTreeExpanderinstance.Declaration
Swift
@inlinable public init(_ op: UnsafePointer<GtkTreeExpander>)Parameters
oppointer to the underlying object
-
Optional initialiser from a non-mutating
gpointerto the underlyingCdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theTreeExpanderinstance.Declaration
Swift
@inlinable override public init!(gpointer op: gpointer?)Parameters
opgpointer to the underlying object
-
Optional initialiser from a non-mutating
gconstpointerto the underlyingCdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theTreeExpanderinstance.Declaration
Swift
@inlinable override public init!(gconstpointer op: gconstpointer?)Parameters
oppointer to the underlying object
-
Optional initialiser from a constant pointer to the underlying
Cdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theTreeExpanderinstance.Declaration
Swift
@inlinable public init!(_ op: UnsafePointer<GtkTreeExpander>?)Parameters
oppointer to the underlying object
-
Optional initialiser from the underlying
Cdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theTreeExpanderinstance.Declaration
Swift
@inlinable public init!(_ op: UnsafeMutablePointer<GtkTreeExpander>?)Parameters
oppointer to the underlying object
-
Designated initialiser from the underlying
Cdata type. Will retainGtkTreeExpander. i.e., ownership is transferred to theTreeExpanderinstance.Declaration
Swift
@inlinable public init(retaining op: UnsafeMutablePointer<GtkTreeExpander>)Parameters
oppointer to the underlying object
-
Reference intialiser for a related type that implements
TreeExpanderProtocolWill retainGtkTreeExpander.Declaration
Swift
@inlinable public init<T>(treeExpander other: T) where T : TreeExpanderProtocolParameters
otheran instance of a related type that implements
TreeExpanderProtocol -
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TreeExpanderProtocol.Declaration
Swift
@inlinable override public init<T>(cPointer p: UnsafeMutablePointer<T>)Parameters
cPointerpointer to the underlying object
-
Unsafe typed, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TreeExpanderProtocol.Declaration
Swift
@inlinable override public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>)Parameters
cPointerpointer to the underlying object
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TreeExpanderProtocol.Declaration
Swift
@inlinable override public init(raw p: UnsafeRawPointer)Parameters
praw pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TreeExpanderProtocol.Declaration
Swift
@inlinable override public init(retainingRaw raw: UnsafeRawPointer) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TreeExpanderProtocol.Declaration
Swift
@inlinable public required init(raw p: UnsafeMutableRawPointer)Parameters
pmutable raw pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TreeExpanderProtocol.Declaration
Swift
@inlinable required public init(retainingRaw raw: UnsafeMutableRawPointer)Parameters
rawmutable raw pointer to the underlying object
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TreeExpanderProtocol.Declaration
Swift
@inlinable override public init(opaquePointer p: OpaquePointer)Parameters
popaque pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TreeExpanderProtocol.Declaration
Swift
@inlinable override public init(retainingOpaquePointer p: OpaquePointer)Parameters
popaque pointer to the underlying object
-
Creates a new
GtkTreeExpanderDeclaration
Swift
@inlinable public init()
View on GitHub
Install in Dash
TreeExpander Class Reference