Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: SorterChangedCallback

[213:7] extends: object

Generated low-level callback wrapper for GIR callback changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • SorterChangedCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, change, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: Sorter

[25:7] extends: object

Describes sorting criteria for a [class@Gtk.SortListModel]. Its primary user is [class@Gtk.SortListModel] The model will use a sorter to determine the order in which its items should appear by calling [method@Gtk.Sorter.compare] for pairs of items. Sorters may change their sorting behavior through their lifetime. In that case, they will emit the [signal@Gtk.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. [class@Gtk.ColumnView] has built-in support for sorting lists via the [property@Gtk.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.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Sorter (Handle = null)

    Creates a new Sorter by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnChanged (callback Fn, UserData = null)

    Emitted whenever the sorter changed. Users of the sorter should then update the sort order again via gtk_sorter_compare(). [class@Gtk.SortListModel] handles this signal automatically. Depending on the @change parameter, it may be possible to update the sort order without a full resorting. Refer to the [enum@Gtk.SorterChange] documentation for details.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (Sorter Self, string Change).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • changed (string change)

    Notifies all users of the sorter that it has changed. This emits the [signal@Gtk.Sorter::changed] signal. Users of the sorter should then update the sort order via [method@Gtk.Sorter.compare]. Depending on the

    • @change parameter, it may be possible to update the sort order without a full resorting. Refer to the [enum@Gtk.SorterChange] documentation for details. This function is intended for implementers of GtkSorter subclasses and should not be called from other functions.
    • @p change is How the sorter changed.
    • @r None.
  • compare (object item1, object item2)

    Compares two given items according to the sort order implemented by the sorter. Sorters implement a partial order: * It is reflexive, ie a = a * It is antisymmetric, ie if a < b and b < a, then a = b * It is transitive, ie given any 3 items with a ≤ b and b ≤ c, then a ≤ c The sorter may signal it conforms to additional constraints via the return value of [method@Gtk.Sorter.get_order].

    • @p item1 is first item to compare.
    • @p item2 is second item to compare.
  • get_order ()

    Gets the order that @self conforms to. See [enum@Gtk.SorterOrder] for details of the possible return values. This function is intended to allow optimizations.

class: SorterMeta

[284:14] static extends: object

Generated metadata helpers for Sorter class surfaces.

Methods

  • signals ()

    Returns signal metadata for Sorter.

    • @r A list.