SorterRef

public struct SorterRef : SorterProtocol, GWeakCapturing

GtkSorter is an object to describe sorting criteria.

Its primary user is [classGtk.SortListModel]

The model will use a sorter to determine the order in which its items should appear by calling [methodGtk.Sorter.compare] for pairs of items.

Sorters may change their sorting behavior through their lifetime. In that case, they will emit the [signalGtk.Sorter::changed] signal to notify that the sort order is no longer valid and should be updated by calling gtk_sorter_compare() again.

GTK provides various pre-made sorter implementations for common sorting operations. [classGtk.ColumnView] has built-in support for sorting lists via the [propertyGtk.ColumnViewColumn:sorter] property, where the user can change the sorting by clicking on list headers.

Of course, in particular for large lists, it is also possible to subclass GtkSorter and provide one’s own sorter.

The SorterRef type acts as a lightweight Swift reference to an underlying GtkSorter instance. It exposes methods that can operate on this data type through SorterProtocol conformance. Use SorterRef only as an unowned reference to an existing GtkSorter instance.

  • ptr
    Untyped pointer to the underlying `GtkSorter` instance.
    

    For type-safe access, use the generated, typed pointer sorter_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

Sorter Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GtkSorter>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GtkSorter>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GtkSorter>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GtkSorter>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements SorterProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : SorterProtocol
  • This factory is syntactic sugar for setting weak pointers wrapped in GWeak<T>

    Declaration

    Swift

    @inlinable
    static func unowned<T>(_ other: T) -> SorterRef where T : SorterProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to SorterProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(cPointer: UnsafeMutablePointer<T>)
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to SorterProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(constPointer: UnsafePointer<T>)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to SorterProtocol.

    Declaration

    Swift

    @inlinable
    init(mutating raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to SorterProtocol.

    Declaration

    Swift

    @inlinable
    init(raw: UnsafeMutableRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to SorterProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)