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.
-
Untyped pointer to the underlying
GtkTreeListModel
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
tree_list_model_ptr
Default implementationTyped 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)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) 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 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 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:
Extension methodvalue: ) 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
-
getAutoexpand()
Extension methodGets 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 [method
Gtk.TreeListRow.set_expanded
].Declaration
Swift
@inlinable func getAutoexpand() -> Bool
-
getChildRow(position:
Extension method) Gets the row item corresponding to the child at index
position
forself
‘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 [method
Gtk.TreeListModel.get_row
].Declaration
Swift
@inlinable func getChildRow(position: Int) -> TreeListRowRef!
-
getModel()
Extension methodGets the root model that
self
was created with.Declaration
Swift
@inlinable func getModel() -> GIO.ListModelRef!
-
getPassthrough()
Extension methodGets whether the model is passing through original row items.
If this function returns
false
, theGListModel
functions forself
return customGtkTreeListRow
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 customGtkTreeListRow
s.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 inself
,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 callingg_list_model_get_item()
.Do not confuse this function with [method
Gtk.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 methodIf all rows should be expanded by default.
Declaration
Swift
@inlinable var autoexpand: Bool { get nonmutating set }
-
model
Extension methodThe root model displayed.
Declaration
Swift
@inlinable var model: GIO.ListModelRef! { get }
-
passthrough
Extension methodGets whether the model is in passthrough mode.
If
false
, theGListModel
functions for this object return custom [classGtk.TreeListRow
] objects. Iftrue
, the values of the child models are pass through unmodified.Declaration
Swift
@inlinable var passthrough: Bool { get }