TreeListModelProtocol

public protocol TreeListModelProtocol : ListModelProtocol, ObjectProtocol

GtkTreeListModel is a list model that can create child models on demand.

The TreeListModelProtocol protocol exposes the methods and properties of an underlying GtkTreeListModel 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 TreeListModel. Alternatively, use TreeListModelRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkTreeListModel instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkTreeListModel instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkTreeListModel instance.

    Declaration

    Swift

    var tree_list_model_ptr: UnsafeMutablePointer<GtkTreeListModel>! { get }
  • Required Initialiser for types conforming to TreeListModelProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

TreeListModel Class

  • Bind a TreeListModelPropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: TreeListModelPropertyName, 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 TreeListModel property

    Declaration

    Swift

    @inlinable
    func get(property: TreeListModelPropertyName) -> 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 TreeListModel property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: TreeListModelPropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

TreeListModel Class: TreeListModelProtocol extension (methods and fields)

  • getAutoexpand() Extension method

    Gets whether the model is set to automatically expand new rows that get added.

    This can be either rows added by changes to the underlying models or via [methodGtk.TreeListRow.set_expanded].

    Declaration

    Swift

    @inlinable
    func getAutoexpand() -> Bool
  • getChildRow(position:) Extension method

    Gets the row item corresponding to the child at index position for self‘s root model.

    If position is greater than the number of children in the root model, nil is returned.

    Do not confuse this function with [methodGtk.TreeListModel.get_row].

    Declaration

    Swift

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

    Gets the root model that self was created with.

    Declaration

    Swift

    @inlinable
    func getModel() -> GIO.ListModelRef!
  • getPassthrough() Extension method

    Gets whether the model is passing through original row items.

    If this function returns false, the GListModel functions for self return custom GtkTreeListRow objects. You need to call [methodGtk.TreeListRow.get_item] on these objects to get the original item.

    If true, the values of the child models are passed through in their original state. You then need to call [methodGtk.TreeListModel.get_row] to get the custom GtkTreeListRows.

    Declaration

    Swift

    @inlinable
    func getPassthrough() -> Bool
  • getRow(position:) Extension method

    Gets the row object for the given row.

    If position is greater than the number of items in self, nil is returned.

    The row object can be used to expand and collapse rows as well as to inspect its position in the tree. See its documentation for details.

    This row object is persistent and will refer to the current item as long as the row is present in self, independent of other rows being added or removed.

    If self is set to not be passthrough, this function is equivalent to calling g_list_model_get_item().

    Do not confuse this function with [methodGtk.TreeListModel.get_child_row].

    Declaration

    Swift

    @inlinable
    func getRow(position: Int) -> TreeListRowRef!
  • set(autoexpand:) Extension method

    Sets whether the model should autoexpand.

    If set to true, the model will recursively expand all rows that get added to the model. This can be either rows added by changes to the underlying models or via [methodGtk.TreeListRow.set_expanded].

    Declaration

    Swift

    @inlinable
    func set(autoexpand: Bool)
  • autoexpand Extension method

    If all rows should be expanded by default.

    Declaration

    Swift

    @inlinable
    var autoexpand: Bool { get nonmutating set }
  • model Extension method

    The root model displayed.

    Declaration

    Swift

    @inlinable
    var model: GIO.ListModelRef! { get }
  • passthrough Extension method

    Gets whether the model is in passthrough mode.

    If false, the GListModel functions for this object return custom [classGtk.TreeListRow] objects. If true, the values of the child models are pass through unmodified.

    Declaration

    Swift

    @inlinable
    var passthrough: Bool { get }