TreeSortableProtocol
public protocol TreeSortableProtocol : TreeModelProtocol
GtkTreeSortable is an interface to be implemented by tree models which
support sorting. The GtkTreeView uses the methods provided by this interface
to sort the model.
The TreeSortableProtocol protocol exposes the methods and properties of an underlying GtkTreeSortable 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 TreeSortable.
Alternatively, use TreeSortableRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkTreeSortableinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
tree_sortable_ptrDefault implementationTyped pointer to the underlying
GtkTreeSortableinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkTreeSortableinstance.Declaration
Swift
var tree_sortable_ptr: UnsafeMutablePointer<GtkTreeSortable>! { get } -
Required Initialiser for types conforming to
TreeSortableProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
TreeSortableSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: TreeSortableSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
TreeSortableSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: TreeSortableSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onSortColumnChanged(flags:Extension methodhandler: ) The
sort-column-changedsignal is emitted when the sort column or sort order ofsortableis changed. The signal is emitted before the contents ofsortableare resorted.Note
This represents the underlyingsort-column-changedsignalDeclaration
Swift
@discardableResult @inlinable func onSortColumnChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TreeSortableRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
sortColumnChangedsignal is emitted -
sortColumnChangedSignalExtension methodTyped
sort-column-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var sortColumnChangedSignal: TreeSortableSignalName { get }
-
get(sortColumnID:Extension methodorder: ) Fills in
sort_column_idandorderwith the current sort column and the order. It returnstrueunless thesort_column_idisGTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_IDorGTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.Declaration
Swift
@inlinable func get(sortColumnID: UnsafeMutablePointer<gint>!, order: UnsafeMutablePointer<GtkSortType>!) -> Bool -
hasDefaultSortFunc()Extension methodReturns
trueif the model has a default sort function. This is used primarily by GtkTreeViewColumns in order to determine if a model can go back to the default state, or not.Declaration
Swift
@inlinable func hasDefaultSortFunc() -> Bool -
setDefault(sortFunc:Extension methoduserData: destroy: ) Sets the default comparison function used when sorting to be
sort_func. If the current sort column id ofsortableisGTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using this function.If
sort_funcisnil, then there will be no default comparison function. This means that once the model has been sorted, it can’t go back to the default state. In this case, when the current sort column id ofsortableisGTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.Declaration
Swift
@inlinable func setDefault(sortFunc: GtkTreeIterCompareFunc?, userData: gpointer! = nil, destroy: GDestroyNotify? = nil) -
set(sortColumnID:Extension methodorder: ) Sets the current sort column to be
sort_column_id. Thesortablewill resort itself to reflect this change, after emitting aGtkTreeSortable::sort-column-changedsignal.sort_column_idmay either be a regular column id, or one of the following special values:GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID:the default sort function will be used, if it is setGTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID:no sorting will occur
Declaration
Swift
@inlinable func set(sortColumnID: Int, order: GtkSortType) -
setSortFunc(sortColumnID:Extension methodsortFunc: userData: destroy: ) Sets the comparison function used when sorting to be
sort_func. If the current sort column id ofsortableis the same assort_column_id, then the model will sort using this function.Declaration
Swift
@inlinable func setSortFunc(sortColumnID: Int, sortFunc: GtkTreeIterCompareFunc?, userData: gpointer! = nil, destroy: GDestroyNotify? = nil) -
sortColumnChanged()Extension methodEmits a
GtkTreeSortable::sort-column-changedsignal onsortable.Declaration
Swift
@inlinable func sortColumnChanged()
View on GitHub
Install in Dash
TreeSortableProtocol Protocol Reference