TreeListRowProtocol
public protocol TreeListRowProtocol : ObjectProtocol
GtkTreeListRow
is used by GtkTreeListModel
to represent items.
It allows navigating the model as a tree and modify the state of rows.
GtkTreeListRow
instances are created by a GtkTreeListModel
only
when the [propertyGtk.TreeListModel:passthrough
] property is not set.
There are various support objects that can make use of GtkTreeListRow
objects, such as the [classGtk.TreeExpander
] widget that allows displaying
an icon to expand or collapse a row or [classGtk.TreeListRowSorter
] that
makes it possible to sort trees properly.
The TreeListRowProtocol
protocol exposes the methods and properties of an underlying GtkTreeListRow
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see TreeListRow
.
Alternatively, use TreeListRowRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkTreeListRow
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
tree_list_row_ptr
Default implementationTyped pointer to the underlying
GtkTreeListRow
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkTreeListRow
instance.Declaration
Swift
var tree_list_row_ptr: UnsafeMutablePointer<GtkTreeListRow>! { get }
-
Required Initialiser for types conforming to
TreeListRowProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
TreeListRowPropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: TreeListRowPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a TreeListRow property
Declaration
Swift
@inlinable func get(property: TreeListRowPropertyName) -> GLibObject.Value
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
set(property:
Extension methodvalue: ) Set the value of a TreeListRow property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: TreeListRowPropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
getChildRow(position:
Extension method) If
self
is not expanded orposition
is greater than the number of children,nil
is returned.Declaration
Swift
@inlinable func getChildRow(position: Int) -> TreeListRowRef!
-
getChildren()
Extension methodIf the row is expanded, gets the model holding the children of
self
.This model is the model created by the [callback
Gtk.TreeListModelCreateModelFunc
] and contains the original items, no matter what value [propertyGtk.TreeListModel:passthrough
] is set to.Declaration
Swift
@inlinable func getChildren() -> GIO.ListModelRef!
-
getDepth()
Extension methodGets the depth of this row.
Rows that correspond to items in the root model have a depth of zero, rows corresponding to items of models of direct children of the root model have a depth of 1 and so on.
The depth of a row never changes until the row is destroyed.
Declaration
Swift
@inlinable func getDepth() -> Int
-
getExpanded()
Extension methodGets if a row is currently expanded.
Declaration
Swift
@inlinable func getExpanded() -> Bool
-
getItem()
Extension methodGets the item corresponding to this row,
The value returned by this function never changes until the row is destroyed.
Declaration
Swift
@inlinable func getItem() -> GLibObject.ObjectRef!
-
getParent()
Extension methodGets the row representing the parent for
self
.That is the row that would need to be collapsed to make this row disappear.
If
self
is a row corresponding to the root model,nil
is returned.The value returned by this function never changes until the row is destroyed.
Declaration
Swift
@inlinable func getParent() -> TreeListRowRef!
-
getPosition()
Extension methodReturns the position in the
GtkTreeListModel
thatself
occupies at the moment.Declaration
Swift
@inlinable func getPosition() -> Int
-
set(expanded:
Extension method) Expands or collapses a row.
If a row is expanded, the model of calling the [callback
Gtk.TreeListModelCreateModelFunc
] for the row’s item will be inserted after this row. If a row is collapsed, those items will be removed from the model.If the row is not expandable, this function does nothing.
Declaration
Swift
@inlinable func set(expanded: Bool)
-
children
Extension methodThe model holding the row’s children.
Declaration
Swift
@inlinable var children: GIO.ListModelRef! { get }
-
depth
Extension methodThe depth in the tree of this row.
Declaration
Swift
@inlinable var depth: Int { get }
-
expanded
Extension methodIf this row is currently expanded.
Declaration
Swift
@inlinable var expanded: Bool { get nonmutating set }
-
isExpandable
Extension methodChecks if a row can be expanded.
This does not mean that the row is actually expanded, this can be checked with [method
Gtk.TreeListRow.get_expanded
].If a row is expandable never changes until the row is destroyed.
Declaration
Swift
@inlinable var isExpandable: Bool { get }
-
item
Extension methodThe item held in this row.
Declaration
Swift
@inlinable var item: GLibObject.ObjectRef! { get }
-
parent
Extension methodGets the row representing the parent for
self
.That is the row that would need to be collapsed to make this row disappear.
If
self
is a row corresponding to the root model,nil
is returned.The value returned by this function never changes until the row is destroyed.
Declaration
Swift
@inlinable var parent: TreeListRowRef! { get }
-
position
Extension methodReturns the position in the
GtkTreeListModel
thatself
occupies at the moment.Declaration
Swift
@inlinable var position: Int { get }