ListBoxProtocol

public protocol ListBoxProtocol : WidgetProtocol

GtkListBox is a vertical list.

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 [methodGtk.ListBox.prepend], [methodGtk.ListBox.append] and [methodGtk.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, [signalGtk.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 [methodGtk.ListBox.set_placeholder] for info.

CSS nodes

(plain Language Example):

list[.separators][.rich-list][.navigation-sidebar]
╰── row[.activatable]

GtkListBox uses a single CSS node named list. It may carry the .separators style class, when the [propertyGtk.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.

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 GTK_ACCESSIBLE_ROLE_LIST role and GtkListBoxRow uses the GTK_ACCESSIBLE_ROLE_LIST_ITEM role.

The ListBoxProtocol protocol exposes the methods and properties of an underlying GtkListBox instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see ListBox. Alternatively, use ListBoxRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkListBox instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • list_box_ptr Default implementation

    Typed pointer to the underlying GtkListBox instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkListBox instance.

    Declaration

    Swift

    var list_box_ptr: UnsafeMutablePointer<GtkListBox>! { get }
  • Required Initialiser for types conforming to ListBoxProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

ListBox Class

  • Bind a ListBoxPropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: ListBoxPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a ListBox property

    Declaration

    Swift

    @inlinable
    func get(property: ListBoxPropertyName) -> GLibObject.Value

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    Set the value of a ListBox property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: ListBoxPropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

ListBox signals

  • Connect a Swift signal handler to the given, typed ListBoxSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: ListBoxSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    handler

    The Swift signal handler (function or callback) to invoke on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • Connect a C signal handler to the given, typed ListBoxSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: ListBoxSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    signalHandler

    The C function to be called on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • Note

    This represents the underlying activate-cursor-row signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onActivateCursorRow(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ListBoxRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the activateCursorRow signal is emitted

  • activateCursorRowSignal Extension method

    Typed activate-cursor-row signal for using the connect(signal:) methods

    Declaration

    Swift

    static var activateCursorRowSignal: ListBoxSignalName { get }
  • onMoveCursor(flags:handler:) Extension method

    Note

    This represents the underlying move-cursor signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onMoveCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ListBoxRef, _ object: MovementStep, _ p0: Int, _ p1: Bool, _ p2: Bool) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    object

    none

    p0

    none

    p1

    none

    p2

    none

    handler

    The signal handler to call Run the given callback whenever the moveCursor signal is emitted

  • moveCursorSignal Extension method

    Typed move-cursor signal for using the connect(signal:) methods

    Declaration

    Swift

    static var moveCursorSignal: ListBoxSignalName { get }
  • Emitted when a row has been activated by the user.

    Note

    This represents the underlying row-activated signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onRowActivated(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ListBoxRef, _ row: ListBoxRowRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    row

    the activated row

    handler

    The signal handler to call Run the given callback whenever the rowActivated signal is emitted

  • rowActivatedSignal Extension method

    Typed row-activated signal for using the connect(signal:) methods

    Declaration

    Swift

    static var rowActivatedSignal: ListBoxSignalName { get }
  • Emitted when a new row is selected, or (with a nil 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 [signalGtk.ListBox::selected-rows-changed] signal instead.

    Note

    This represents the underlying row-selected signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onRowSelected(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ListBoxRef, _ row: ListBoxRowRef?) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    row

    the selected row

    handler

    The signal handler to call Run the given callback whenever the rowSelected signal is emitted

  • rowSelectedSignal Extension method

    Typed row-selected signal for using the connect(signal:) methods

    Declaration

    Swift

    static var rowSelectedSignal: ListBoxSignalName { get }
  • onSelectAll(flags:handler:) Extension method

    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 <kbd>Ctrl</kbd>-<kbd>a</kbd>.

    Note

    This represents the underlying select-all signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onSelectAll(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ListBoxRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the selectAll signal is emitted

  • selectAllSignal Extension method

    Typed select-all signal for using the connect(signal:) methods

    Declaration

    Swift

    static var selectAllSignal: ListBoxSignalName { get }
  • Emitted when the set of selected rows changes.

    Note

    This represents the underlying selected-rows-changed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onSelectedRowsChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ListBoxRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the selectedRowsChanged signal is emitted

  • selectedRowsChangedSignal Extension method

    Typed selected-rows-changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var selectedRowsChangedSignal: ListBoxSignalName { get }
  • Note

    This represents the underlying toggle-cursor-row signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onToggleCursorRow(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ListBoxRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the toggleCursorRow signal is emitted

  • toggleCursorRowSignal Extension method

    Typed toggle-cursor-row signal for using the connect(signal:) methods

    Declaration

    Swift

    static var toggleCursorRowSignal: ListBoxSignalName { get }
  • 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 <kbd>Ctrl</kbd>-<kbd>Shift</kbd>-<kbd>a</kbd>.

    Note

    This represents the underlying unselect-all signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onUnselectAll(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ListBoxRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the unselectAll signal is emitted

  • unselectAllSignal Extension method

    Typed unselect-all signal for using the connect(signal:) methods

    Declaration

    Swift

    static var unselectAllSignal: ListBoxSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::accept-unpaired-release signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyAcceptUnpairedRelease(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ListBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyAcceptUnpairedRelease signal is emitted

  • Typed notify::accept-unpaired-release signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyAcceptUnpairedReleaseSignal: ListBoxSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::activate-on-single-click signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyActivateOnSingleClick(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ListBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyActivateOnSingleClick signal is emitted

  • Typed notify::activate-on-single-click signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyActivateOnSingleClickSignal: ListBoxSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::selection-mode signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifySelectionMode(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ListBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifySelectionMode signal is emitted

  • notifySelectionModeSignal Extension method

    Typed notify::selection-mode signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifySelectionModeSignal: ListBoxSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::show-separators signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyShowSeparators(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ListBoxRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyShowSeparators signal is emitted

  • notifyShowSeparatorsSignal Extension method

    Typed notify::show-separators signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyShowSeparatorsSignal: ListBoxSignalName { get }

ListBox Class: ListBoxProtocol extension (methods and fields)

  • append(child:) Extension method

    Append a widget to the list.

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

    Declaration

    Swift

    @inlinable
    func append<WidgetT>(child: WidgetT) where WidgetT : WidgetProtocol
  • Binds model to box.

    If box was already bound to a model, that previous binding is destroyed.

    The contents of box are cleared and then filled with widgets that represent items from model. box is updated whenever model changes. If model is nil, box is left empty.

    It is undefined to add or remove widgets directly (for example, with [methodGtk.ListBox.insert]) while box is bound to a model.

    Note that using a model is incompatible with the filtering and sorting functionality in GtkListBox. When using a model, filtering and sorting should be implemented by the model.

    Declaration

    Swift

    @inlinable
    func bind(model: GIO.ListModelRef? = nil, createWidgetFunc: GtkListBoxCreateWidgetFunc? = nil, userData: gpointer! = nil, userDataFreeFunc: GDestroyNotify?)
  • Binds model to box.

    If box was already bound to a model, that previous binding is destroyed.

    The contents of box are cleared and then filled with widgets that represent items from model. box is updated whenever model changes. If model is nil, box is left empty.

    It is undefined to add or remove widgets directly (for example, with [methodGtk.ListBox.insert]) while box is bound to a model.

    Note that using a model is incompatible with the filtering and sorting functionality in GtkListBox. When using a model, filtering and sorting should be implemented by the model.

    Declaration

    Swift

    @inlinable
    func bind<ListModelT>(model: ListModelT?, createWidgetFunc: GtkListBoxCreateWidgetFunc? = nil, userData: gpointer! = nil, userDataFreeFunc: GDestroyNotify?) where ListModelT : ListModelProtocol
  • dragHighlight(row:) Extension method

    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.

    Declaration

    Swift

    @inlinable
    func dragHighlight<ListBoxRowT>(row: ListBoxRowT) where ListBoxRowT : ListBoxRowProtocol
  • dragUnhighlightRow() Extension method

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

    Declaration

    Swift

    @inlinable
    func dragUnhighlightRow()
  • getActivateOnSingleClick() Extension method

    Returns whether rows activate on single clicks.

    Declaration

    Swift

    @inlinable
    func getActivateOnSingleClick() -> Bool
  • getAdjustment() Extension method

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

    Declaration

    Swift

    @inlinable
    func getAdjustment() -> AdjustmentRef!
  • getRowAt(index:) Extension method

    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, nil is returned.

    Declaration

    Swift

    @inlinable
    func getRowAt(index: Int) -> ListBoxRowRef!
  • getRowAt(y:) Extension method

    Gets the row at the y position.

    Declaration

    Swift

    @inlinable
    func getRowAt(y: Int) -> ListBoxRowRef!
  • getSelectedRow() Extension method

    Gets the selected row, or nil if no rows are selected.

    Note that the box may allow multiple selection, in which case you should use [methodGtk.ListBox.selected_foreach] to find all selected rows.

    Declaration

    Swift

    @inlinable
    func getSelectedRow() -> ListBoxRowRef!
  • getSelectedRows() Extension method

    Creates a list of all selected children.

    Declaration

    Swift

    @inlinable
    func getSelectedRows() -> GLib.ListRef!
  • getSelectionMode() Extension method

    Gets the selection mode of the listbox.

    Declaration

    Swift

    @inlinable
    func getSelectionMode() -> GtkSelectionMode
  • getShowSeparators() Extension method

    Returns whether the list box should show separators between rows.

    Declaration

    Swift

    @inlinable
    func getShowSeparators() -> Bool
  • insert(child:position:) Extension method

    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.

    Declaration

    Swift

    @inlinable
    func insert<WidgetT>(child: WidgetT, position: Int) where WidgetT : WidgetProtocol
  • invalidateFilter() Extension method

    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.

    Declaration

    Swift

    @inlinable
    func invalidateFilter()
  • invalidateHeaders() Extension method

    Update the separators for all rows.

    Call this when result of the header function on the box is changed due to an external factor.

    Declaration

    Swift

    @inlinable
    func invalidateHeaders()
  • invalidateSort() Extension method

    Update the sorting for all rows.

    Call this when result of the sort function on the box is changed due to an external factor.

    Declaration

    Swift

    @inlinable
    func invalidateSort()
  • prepend(child:) Extension method

    Prepend a widget to the list.

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

    Declaration

    Swift

    @inlinable
    func prepend<WidgetT>(child: WidgetT) where WidgetT : WidgetProtocol
  • remove(child:) Extension method

    Removes a child from box.

    Declaration

    Swift

    @inlinable
    func remove<WidgetT>(child: WidgetT) where WidgetT : WidgetProtocol
  • selectAll() Extension method

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

    Declaration

    Swift

    @inlinable
    func selectAll()
  • select(row:) Extension method

    Make row the currently selected row.

    Declaration

    Swift

    @inlinable
    func select(row: ListBoxRowRef? = nil)
  • select(row:) Extension method

    Make row the currently selected row.

    Declaration

    Swift

    @inlinable
    func select<ListBoxRowT>(row: ListBoxRowT?) where ListBoxRowT : ListBoxRowProtocol
  • selectedForeach(func:data:) Extension method

    Calls a function for each selected child.

    Note that the selection cannot be modified from within this function.

    Declaration

    Swift

    @inlinable
    func selectedForeach(func: GtkListBoxForeachFunc?, data: gpointer! = nil)
  • If single is true, rows will be activated when you click on them, otherwise you need to double-click.

    Declaration

    Swift

    @inlinable
    func setActivateOnSingleClick(single: Bool)
  • set(adjustment:) Extension method

    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.

    Declaration

    Swift

    @inlinable
    func set(adjustment: AdjustmentRef? = nil)
  • set(adjustment:) Extension method

    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.

    Declaration

    Swift

    @inlinable
    func set<AdjustmentT>(adjustment: AdjustmentT?) where AdjustmentT : AdjustmentProtocol
  • By setting a filter function on the box one can decide dynamically which of the rows to show.

    For instance, to implement a search function on a list that filters the original list to only show the matching rows.

    The filter_func will be called for each row after the call, and it will continue to be called each time a row changes (via [methodGtk.ListBoxRow.changed]) or when [methodGtk.ListBox.invalidate_filter] is called.

    Note that using a filter function is incompatible with using a model (see [methodGtk.ListBox.bind_model]).

    Declaration

    Swift

    @inlinable
    func set(filterFunc: GtkListBoxFilterFunc? = nil, userData: gpointer! = nil, destroy: GDestroyNotify?)
  • Sets a header function.

    By setting a header function on the box one can dynamically add headers in front of rows, depending on the contents of the row and its position in the list.

    For instance, one could use it to add headers in front of the first item of a new kind, in a list sorted by the kind.

    The update_header can look at the current header widget using [methodGtk.ListBoxRow.get_header] and either update the state of the widget as needed, or set a new one using [methodGtk.ListBoxRow.set_header]. If no header is needed, set the header to nil.

    Note that you may get many calls update_header to this for a particular row when e.g. changing things that don’t affect the header. In this case it is important for performance to not blindly replace an existing header with an identical one.

    The update_header function will be called for each row after the call, and it will continue to be called each time a row changes (via [methodGtk.ListBoxRow.changed]) and when the row before changes (either by [methodGtk.ListBoxRow.changed] on the previous row, or when the previous row becomes a different row). It is also called for all rows when [methodGtk.ListBox.invalidate_headers] is called.

    Declaration

    Swift

    @inlinable
    func setHeaderFunc(updateHeader: GtkListBoxUpdateHeaderFunc? = nil, userData: gpointer! = nil, destroy: GDestroyNotify?)
  • set(placeholder:) Extension method

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

    Declaration

    Swift

    @inlinable
    func set(placeholder: WidgetRef? = nil)
  • set(placeholder:) Extension method

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

    Declaration

    Swift

    @inlinable
    func set<WidgetT>(placeholder: WidgetT?) where WidgetT : WidgetProtocol
  • setSelection(mode:) Extension method

    Sets how selection works in the listbox.

    Declaration

    Swift

    @inlinable
    func setSelection(mode: GtkSelectionMode)
  • set(showSeparators:) Extension method

    Sets whether the list box should show separators between rows.

    Declaration

    Swift

    @inlinable
    func set(showSeparators: Bool)
  • Sets a sort function.

    By setting a sort function on the box one can dynamically reorder the rows of the list, based on the contents of the rows.

    The sort_func will be called for each row after the call, and will continue to be called each time a row changes (via [methodGtk.ListBoxRow.changed]) and when [methodGtk.ListBox.invalidate_sort] is called.

    Note that using a sort function is incompatible with using a model (see [methodGtk.ListBox.bind_model]).

    Declaration

    Swift

    @inlinable
    func set(sortFunc: GtkListBoxSortFunc? = nil, userData: gpointer! = nil, destroy: GDestroyNotify?)
  • unselectAll() Extension method

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

    Declaration

    Swift

    @inlinable
    func unselectAll()
  • unselect(row:) Extension method

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

    Declaration

    Swift

    @inlinable
    func unselect<ListBoxRowT>(row: ListBoxRowT) where ListBoxRowT : ListBoxRowProtocol
  • activateOnSingleClick Extension method

    Returns whether rows activate on single clicks.

    Declaration

    Swift

    @inlinable
    var activateOnSingleClick: Bool { get nonmutating set }
  • adjustment Extension method

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

    Declaration

    Swift

    @inlinable
    var adjustment: AdjustmentRef! { get nonmutating set }
  • selectedRow Extension method

    Gets the selected row, or nil if no rows are selected.

    Note that the box may allow multiple selection, in which case you should use [methodGtk.ListBox.selected_foreach] to find all selected rows.

    Declaration

    Swift

    @inlinable
    var selectedRow: ListBoxRowRef! { get }
  • selectedRows Extension method

    Creates a list of all selected children.

    Declaration

    Swift

    @inlinable
    var selectedRows: GLib.ListRef! { get }
  • selectionMode Extension method

    Gets the selection mode of the listbox.

    Declaration

    Swift

    @inlinable
    var selectionMode: GtkSelectionMode { get nonmutating set }
  • showSeparators Extension method

    Returns whether the list box should show separators between rows.

    Declaration

    Swift

    @inlinable
    var showSeparators: Bool { get nonmutating set }