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
GtkTreeListRowinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
tree_list_row_ptrDefault implementationTyped pointer to the underlying
GtkTreeListRowinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkTreeListRowinstance.Declaration
Swift
var tree_list_row_ptr: UnsafeMutablePointer<GtkTreeListRow>! { get } -
Required Initialiser for types conforming to
TreeListRowProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
TreeListRowPropertyNamesource 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 : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a TreeListRow property
Declaration
Swift
@inlinable func get(property: TreeListRowPropertyName) -> GLibObject.ValueParameters
propertythe 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
propertythe property to get the value for
Return Value
the value of the named property
-
getChildRow(position:Extension method) If
selfis not expanded orpositionis greater than the number of children,nilis 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
selfis a row corresponding to the root model,nilis 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
GtkTreeListModelthatselfoccupies 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) -
childrenExtension methodThe model holding the row’s children.
Declaration
Swift
@inlinable var children: GIO.ListModelRef! { get } -
depthExtension methodThe depth in the tree of this row.
Declaration
Swift
@inlinable var depth: Int { get } -
expandedExtension methodIf this row is currently expanded.
Declaration
Swift
@inlinable var expanded: Bool { get nonmutating set } -
isExpandableExtension 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 } -
itemExtension methodThe item held in this row.
Declaration
Swift
@inlinable var item: GLibObject.ObjectRef! { get } -
parentExtension methodGets the row representing the parent for
self.That is the row that would need to be collapsed to make this row disappear.
If
selfis a row corresponding to the root model,nilis returned.The value returned by this function never changes until the row is destroyed.
Declaration
Swift
@inlinable var parent: TreeListRowRef! { get } -
positionExtension methodReturns the position in the
GtkTreeListModelthatselfoccupies at the moment.Declaration
Swift
@inlinable var position: Int { get }
View on GitHub
Install in Dash
TreeListRowProtocol Protocol Reference