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.

  • ptr

    Untyped pointer to the underlying GtkTreeListRow instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • tree_list_row_ptr Default implementation

    Typed 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)

TreeListRow Class

  • 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 transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return 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:value:) Extension method

    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

TreeListRow Class: TreeListRowProtocol extension (methods and fields)

  • getChildRow(position:) Extension method

    If self is not expanded or position is greater than the number of children, nil is returned.

    Declaration

    Swift

    @inlinable
    func getChildRow(position: Int) -> TreeListRowRef!
  • getChildren() Extension method

    If the row is expanded, gets the model holding the children of self.

    This model is the model created by the [callbackGtk.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 method

    Gets 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 method

    Gets if a row is currently expanded.

    Declaration

    Swift

    @inlinable
    func getExpanded() -> Bool
  • getItem() Extension method

    Gets 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 method

    Gets 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 method

    Returns the position in the GtkTreeListModel that self 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 [callbackGtk.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 method

    The model holding the row’s children.

    Declaration

    Swift

    @inlinable
    var children: GIO.ListModelRef! { get }
  • depth Extension method

    The depth in the tree of this row.

    Declaration

    Swift

    @inlinable
    var depth: Int { get }
  • expanded Extension method

    If this row is currently expanded.

    Declaration

    Swift

    @inlinable
    var expanded: Bool { get nonmutating set }
  • isExpandable Extension method

    Checks if a row can be expanded.

    This does not mean that the row is actually expanded, this can be checked with [methodGtk.TreeListRow.get_expanded].

    If a row is expandable never changes until the row is destroyed.

    Declaration

    Swift

    @inlinable
    var isExpandable: Bool { get }
  • item Extension method

    The item held in this row.

    Declaration

    Swift

    @inlinable
    var item: GLibObject.ObjectRef! { get }
  • parent Extension method

    Gets 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 method

    Returns the position in the GtkTreeListModel that self occupies at the moment.

    Declaration

    Swift

    @inlinable
    var position: Int { get }