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
GtkTreeListModelinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
tree_list_model_ptrDefault implementationTyped pointer to the underlying
GtkTreeListModelinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkTreeListModelinstance.Declaration
Swift
var tree_list_model_ptr: UnsafeMutablePointer<GtkTreeListModel>! { get } -
Required Initialiser for types conforming to
TreeListModelProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
TreeListModelPropertyNamesource 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 : 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 TreeListModel property
Declaration
Swift
@inlinable func get(property: TreeListModelPropertyName) -> 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 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
propertythe 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
positionforself‘s root model.If
positionis greater than the number of children in the root model,nilis 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
selfwas 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, theGListModelfunctions forselfreturn customGtkTreeListRowobjects. 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 customGtkTreeListRows.Declaration
Swift
@inlinable func getPassthrough() -> Bool -
getRow(position:Extension method) Gets the row object for the given row.
If
positionis greater than the number of items inself,nilis 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
selfis 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) -
autoexpandExtension methodIf all rows should be expanded by default.
Declaration
Swift
@inlinable var autoexpand: Bool { get nonmutating set } -
modelExtension methodThe root model displayed.
Declaration
Swift
@inlinable var model: GIO.ListModelRef! { get } -
passthroughExtension methodGets whether the model is in passthrough mode.
If
false, theGListModelfunctions 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 }
View on GitHub
Install in Dash
TreeListModelProtocol Protocol Reference