TreeExpanderRef
public struct TreeExpanderRef : TreeExpanderProtocol, GWeakCapturing
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 TreeExpanderRef type acts as a lightweight Swift reference to an underlying GtkTreeExpander instance.
It exposes methods that can operate on this data type through TreeExpanderProtocol conformance.
Use TreeExpanderRef only as an unowned reference to an existing GtkTreeExpander instance.
-
Untyped pointer to the underlying `GtkTreeExpander` instance.For type-safe access, use the generated, typed pointer
tree_expander_ptrproperty instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
Cdata typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<GtkTreeExpander>) -
Designated initialiser from a constant pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<GtkTreeExpander>) -
Conditional initialiser from an optional pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GtkTreeExpander>?) -
Conditional initialiser from an optional, non-mutable pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<GtkTreeExpander>?) -
Conditional initialiser from an optional
gpointerDeclaration
Swift
@inlinable init!(gpointer g: gpointer?) -
Conditional initialiser from an optional, non-mutable
gconstpointerDeclaration
Swift
@inlinable init!(gconstpointer g: gconstpointer?) -
Reference intialiser for a related type that implements
TreeExpanderProtocolDeclaration
Swift
@inlinable init<T>(_ other: T) where T : TreeExpanderProtocol -
This factory is syntactic sugar for setting weak pointers wrapped in
GWeak<T>Declaration
Swift
@inlinable static func unowned<T>(_ other: T) -> TreeExpanderRef where T : TreeExpanderProtocol -
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TreeExpanderProtocol.Declaration
Swift
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) -
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TreeExpanderProtocol.Declaration
Swift
@inlinable init<T>(constPointer: UnsafePointer<T>) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TreeExpanderProtocol.Declaration
Swift
@inlinable init(mutating 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 init(raw: UnsafeMutableRawPointer) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
TreeExpanderProtocol.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer) -
Creates a new
GtkTreeExpanderDeclaration
Swift
@inlinable init()
View on GitHub
Install in Dash
TreeExpanderRef Structure Reference