Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ListBoxTogglecursorrowCallback

[1198:7] extends: object

Generated low-level callback wrapper for GIR callback toggle-cursor-row.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ListBoxTogglecursorrowCallback (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, 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: ListBoxRowactivatedCallback

[915:7] extends: object

Generated low-level callback wrapper for GIR callback row-activated.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ListBoxRowactivatedCallback (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, row, 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: ListBox

[48:7] extends: object

Shows a vertical list. An example GtkListBox A GtkListBox only contains GtkListBoxRow children. These rows can by dynamically sorted and filtered, and headers can be added dynamically depending on the row content. It also allows keyboard and mouse navigation and selection like a typical list. Using GtkListBox is often an alternative to GtkTreeView, especially when the list contents has a more complicated layout than what is allowed by a GtkCellRenderer, or when the contents is interactive (i.e. has a button in it). Although a GtkListBox must have only GtkListBoxRow children, you can add any kind of widget to it via [method@Gtk.ListBox.prepend], [method@Gtk.ListBox.append] and [method@Gtk.ListBox.insert] and a GtkListBoxRow widget will automatically be inserted between the list and the widget. GtkListBoxRows can be marked as activatable or selectable. If a row is activatable, [signal@Gtk.ListBox::row-activated] will be emitted for it when the user tries to activate it. If it is selectable, the row will be marked as selected when the user tries to select it. # GtkListBox as GtkBuildable The GtkListBox implementation of the GtkBuildable interface supports setting a child as the placeholder by specifying “placeholder” as the “type” attribute of a <child> element. See [method@Gtk.ListBox.set_placeholder] for info. # Shortcuts and Gestures The following signals have default keybindings: - [signal@Gtk.ListBox::move-cursor] - [signal@Gtk.ListBox::select-all] - [signal@Gtk.ListBox::toggle-cursor-row] - [signal@Gtk.ListBox::unselect-all] # CSS nodes list[.separators][.rich-list][.navigation-sidebar][.boxed-list] ╰── row[.activatable] GtkListBox uses a single CSS node named list. It may carry the .separators style class, when the [property@Gtk.ListBox:show-separators] property is set. Each GtkListBoxRow uses a single CSS node named row. The row nodes get the .activatable style class added when appropriate. It may also carry the .boxed-list style class. In this case, the list will be automatically surrounded by a frame and have separators. The main list node may also carry style classes to select the style of list presentation: .rich-list, .navigation-sidebar or .data-table. # Accessibility GtkListBox uses the [enum@Gtk.AccessibleRole.list] role and GtkListBoxRow uses the [enum@Gtk.AccessibleRole.list_item] role.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • ListBox ()

    Creates a new GtkListBox container.

  • 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.
  • asWidget ()

    Wraps this handle as Widget.

    • @r A Widget object.
  • asAccessible ()

    Wraps this handle as Accessible.

    • @r A Accessible object.
  • asBuildable ()

    Wraps this handle as Buildable.

    • @r A Buildable object.
  • asConstraintTarget ()

    Wraps this handle as ConstraintTarget.

    • @r A ConstraintTarget 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.
  • setOnActivatecursorrow (callback Fn, UserData = null)

    Emitted when the cursor row is activated.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ListBox Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnMovecursor (callback Fn, UserData = null)

    Emitted when the user initiates a cursor movement. The default bindings for this signal come in two variants, the variant with the Shift modifier extends the selection, the variant without the Shift modifier does not. There are too many key combinations to list them all here. - , , , move by individual children - Home, End move to the ends of the box - PgUp, PgDn move vertically by pages

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ListBox Self, string Step, int Count, bool Extend, bool Modify).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnRowactivated (callback Fn, UserData = null)

    Emitted when a row has been activated by the user.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ListBox Self, ListBoxRow Row).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnRowselected (callback Fn, UserData = null)

    Emitted when a new row is selected, or (with a %NULL @row) when the selection is cleared. When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not give you the full picture of selection changes, and you should use the [signal@Gtk.ListBox::selected-rows-changed] signal instead.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ListBox Self, ListBoxRow Row).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnSelectall (callback Fn, UserData = null)

    Emitted to select all children of the box, if the selection mode permits it. This is a keybinding signal. The default binding for this signal is Ctrl-a.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ListBox Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnSelectedrowschanged (callback Fn, UserData = null)

    Emitted when the set of selected rows changes.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ListBox Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnTogglecursorrow (callback Fn, UserData = null)

    Emitted when the cursor row is toggled. The default bindings for this signal is Ctrl+.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ListBox Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnUnselectall (callback Fn, UserData = null)

    Emitted to unselect all children of the box, if the selection mode permits it. This is a keybinding signal. The default binding for this signal is Ctrl-Shift-a.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ListBox Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setAcceptunpairedrelease (bool Value)

    Whether to accept unpaired release events.

    • @p Value is the new property value.
    • @r None.
  • setActivateonsingleclick (bool Value)

    Determines whether children can be activated with a single click, or require a double-click.

    • @p Value is the new property value.
    • @r None.
  • setSelectionmode (string Value)

    The selection mode used by the list box.

    • @p Value is the new property value.
    • @r None.
  • setShowseparators (bool Value)

    Whether to show separators between rows.

    • @p Value is the new property value.
    • @r None.
  • setTabbehavior (string Value)

    Behavior of the Tab key

    • @p Value is the new property value.
    • @r None.
  • append (object child)

    Append a widget to the list. If a sort function is set, the widget will actually be inserted at the calculated position.

    • @p child is the GtkWidget to add.
    • @r None.
  • drag_highlight_row (object row)

    Add a drag highlight to a row. This is a helper function for implementing DnD onto a GtkListBox. The passed in @row will be highlighted by setting the %GTK_STATE_FLAG_DROP_ACTIVE state and any previously highlighted row will be unhighlighted. The row will also be unhighlighted when the widget gets a drag leave event.

    • @p row is a GtkListBoxRow.
    • @r None.
  • drag_unhighlight_row ()

    If a row has previously been highlighted via gtk_list_box_drag_highlight_row(), it will have the highlight removed.

    • @r None.
  • get_activate_on_single_click ()

    Returns whether rows activate on single clicks.

  • get_adjustment ()

    Gets the adjustment (if any) that the widget uses to for vertical scrolling.

  • get_row_at_index (int index_)

    Gets the n-th child in the list (not counting headers). If @index_ is negative or larger than the number of items in the list, %NULL is returned.

    • @p index_ is the index of the row.
  • get_row_at_y (int y)

    Gets the row at the @y position.

    • @p y is position.
  • get_selected_row ()

    Gets the selected row, or %NULL if no rows are selected. Note that the box may allow multiple selection, in which case you should use [method@Gtk.ListBox.selected_foreach] to find all selected rows.

  • get_selected_rows ()

    Creates a list of all selected children.

  • get_selection_mode ()

    Gets the selection mode of the listbox.

  • get_show_separators ()

    Returns whether the list box should show separators between rows.

  • get_tab_behavior ()

    Returns the behavior of the Tab and Shift+Tab keys.

  • insert (object child, int position)

    Insert the @child into the @box at @position. If a sort function is set, the widget will actually be inserted at the calculated position. If

    • @position is -1, or larger than the total number of items in the @box, then the @child will be appended to the end.
    • @p child is the GtkWidget to add.
    • @p position is the position to insert @child in.
    • @r None.
  • invalidate_filter ()

    Update the filtering for all rows. Call this when result of the filter function on the @box is changed due to an external factor. For instance, this would be used if the filter function just looked for a specific search string and the entry with the search string has changed.

    • @r None.
  • invalidate_headers ()

    Update the separators for all rows. Call this when result of the header function on the @box is changed due to an external factor.

    • @r None.
  • invalidate_sort ()

    Update the sorting for all rows. Call this when result of the sort function on the @box is changed due to an external factor.

    • @r None.
  • prepend (object child)

    Prepend a widget to the list. If a sort function is set, the widget will actually be inserted at the calculated position.

    • @p child is the GtkWidget to add.
    • @r None.
  • remove (object child)

    Removes a child from @box.

    • @p child is the child to remove.
    • @r None.
  • remove_all ()

    Removes all rows from @box. This function does nothing if @box is backed by a model.

    • @r None.
  • select_all ()

    Select all children of @box, if the selection mode allows it.

    • @r None.
  • select_row (object row)

    Make @row the currently selected row.

    • @p row is The row to select.
    • @r None.
  • set_activate_on_single_click (bool single)

    If @single is %TRUE, rows will be activated when you click on them, otherwise you need to double-click.

    • @p single is a boolean.
    • @r None.
  • set_adjustment (object adjustment)

    Sets the adjustment (if any) that the widget uses to for vertical scrolling. For instance, this is used to get the page size for PageUp/Down key handling. In the normal case when the @box is packed inside a GtkScrolledWindow the adjustment from that will be picked up automatically, so there is no need to manually do that.

    • @p adjustment is the adjustment.
    • @r None.
  • set_placeholder (object placeholder)

    Sets the placeholder widget that is shown in the list when it doesn't display any visible children.

    • @p placeholder is a GtkWidget.
    • @r None.
  • set_selection_mode (string mode)

    Sets how selection works in the listbox.

    • @p mode is The GtkSelectionMode.
    • @r None.
  • set_show_separators (bool show_separators)

    Sets whether the list box should show separators between rows.

    • @p show_separators is %TRUE to show separators.
    • @r None.
  • set_tab_behavior (string behavior)

    Sets the behavior of the Tab and Shift+Tab keys.

    • @p behavior is the tab behavior.
    • @r None.
  • unselect_all ()

    Unselect all children of @box, if the selection mode allows it.

    • @r None.
  • unselect_row (object row)

    Unselects a single row of @box, if the selection mode allows it.

    • @p row is the row to unselect.
    • @r None.
  • selected_rows ()

    Returns get_selected_rows as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use get_selected_rows() when lazy or change-notify access is required.

    • @r An Aussom list of elements.

class: ListBoxUnselectallCallback

[1268:7] extends: object

Generated low-level callback wrapper for GIR callback unselect-all.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ListBoxUnselectallCallback (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, 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: ListBoxRowselectedCallback

[986:7] extends: object

Generated low-level callback wrapper for GIR callback row-selected.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ListBoxRowselectedCallback (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, row, 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: ListBoxSelectallCallback

[1057:7] extends: object

Generated low-level callback wrapper for GIR callback select-all.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ListBoxSelectallCallback (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, 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: ListBoxActivatecursorrowCallback

[772:7] extends: object

Generated low-level callback wrapper for GIR callback activate-cursor-row.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ListBoxActivatecursorrowCallback (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, 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: ListBoxSelectedrowschangedCallback

[1128:7] extends: object

Generated low-level callback wrapper for GIR callback selected-rows-changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ListBoxSelectedrowschangedCallback (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, 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: ListBoxMeta

[1338:14] static extends: object

Generated metadata helpers for ListBox class surfaces.

Methods

  • properties ()

    Returns property metadata for ListBox.

    • @r A list.
  • signals ()

    Returns signal metadata for ListBox.

    • @r A list.

class: ListBoxMovecursorCallback

[842:7] extends: object

Generated low-level callback wrapper for GIR callback move-cursor.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ListBoxMovecursorCallback (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, step, count, extend, modify, 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.