Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ListStore

[15:7] extends: object

GListStore is a simple implementation of [iface@Gio.ListModel] that stores all items in memory. It provides insertions, deletions, and lookups in logarithmic time with a fast path for the common case of iterating the list linearly.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • ListStore (Handle = null)

    Creates a new ListStore 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.
  • asListModel ()

    Wraps this handle as ListModel.

    • @r A ListModel object.
  • append (object item)

    Appends @item to @store. @item must be of type #GListStore:item-type. This function takes a ref on @item. Use g_list_store_splice() to append multiple items at the same time efficiently.

    • @p item is the new item.
    • @r None.
  • insert (int position, object item)

    Inserts @item into @store at @position. @item must be of type #GListStore:item-type or derived from it. @position must be smaller than the length of the list, or equal to it to append. This function takes a ref on @item. Use g_list_store_splice() to insert multiple items at the same time efficiently.

    • @p position is the position at which to insert the new item.
    • @p item is the new item.
    • @r None.
  • remove (int position)

    Removes the item from @store that is at @position. @position must be smaller than the current length of the list. Use g_list_store_splice() to remove multiple items at the same time efficiently.

    • @p position is the position of the item that is to be removed.
    • @r None.
  • remove_all ()

    Removes all items from @store.

    • @r None.

class: ListStoreMeta

[161:14] static extends: object

Generated metadata helpers for ListStore class surfaces.

Methods

  • properties ()

    Returns property metadata for ListStore.

    • @r A list.