Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: SectionModelMeta

[252:14] static extends: object

Generated metadata helpers for SectionModel interface surfaces.

Methods

  • signals ()

    Returns signal metadata for SectionModel.

    • @r A list.

class: SectionModelSectionschangedCallback

[182:7] extends: object

Generated low-level callback wrapper for GIR callback sections-changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • SectionModelSectionschangedCallback (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, position, n_items, 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: SectionModel

[22:7] extends: object

An interface that adds support for sections to list models. A GtkSectionModel groups successive items into so-called sections. List widgets like GtkListView and GtkGridView then allow displaying section headers for these sections by installing a header factory. Many GTK list models support sections inherently, or they pass through the sections of a model they are wrapping. When the section groupings of a model change, the model will emit the [signal@Gtk.SectionModel::sections-changed] signal by calling the [method@Gtk.SectionModel.sections_changed] function. All sections in the given range then need to be queried again. The [signal@Gio.ListModel::items-changed] signal has the same effect, all sections in that range are invalidated, too.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • SectionModel (Handle = null)

    Creates a new SectionModel 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.
  • 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.
  • setOnSectionschanged (callback Fn, UserData = null)

    Emitted when the start-of-section state of some of the items in @model changes. Note that this signal does not specify the new section state of the items, they need to be queried manually. It is also not necessary for a model to change the section state of any of the items in the section model, though it would be rather useless to emit such a signal. The [signal@Gio.ListModel::items-changed] implies the effect of the [signal@Gtk.SectionModel::sections-changed] signal for all the items it covers.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (SectionModel Self, int Position, int N_items).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • sections_changed (int position, int n_items)

    This function emits the [signal@Gtk.SectionModel::sections-changed] signal to notify about changes to sections. It must cover all positions that used to be a section start or that are now a section start. It does not have to cover all positions for which the section has changed. The [signal@Gio.ListModel::items-changed] implies the effect of the [signal@Gtk.SectionModel::sections-changed] signal for all the items it covers. It is recommended that when changes to the items cause section changes in a larger range, that the larger range is included in the emission of the [signal@Gio.ListModel::items-changed] instead of emitting two signals.

    • @p position is the first changed item.
    • @p n_items is the number of changed items.
    • @r None.