Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: FlowBox

[39:7] extends: object

Puts child widgets in a reflowing grid. An
example GtkFlowBox For instance, with the horizontal orientation, the widgets will be arranged from left to right, starting a new row under the previous row when necessary. Reducing the width in this case will require more rows, so a larger height will be requested. Likewise, with the vertical orientation, the widgets will be arranged from top to bottom, starting a new column to the right when necessary. Reducing the height will require more columns, so a larger width will be requested. The size request of a GtkFlowBox alone may not be what you expect; if you need to be able to shrink it along both axes and dynamically reflow its children, you may have to wrap it in a GtkScrolledWindow to enable that. The children of a GtkFlowBox can be dynamically sorted and filtered. Although a GtkFlowBox must have only GtkFlowBoxChild children, you can add any kind of widget to it via [method@Gtk.FlowBox.insert], and a GtkFlowBoxChild widget will automatically be inserted between the box and the widget. Also see [class@Gtk.ListBox]. # Shortcuts and Gestures The following signals have default keybindings: - [signal@Gtk.FlowBox::move-cursor] - [signal@Gtk.FlowBox::select-all] - [signal@Gtk.FlowBox::toggle-cursor-child] - [signal@Gtk.FlowBox::unselect-all] # CSS nodes flowbox ├── flowboxchild │ ╰── <child> ├── flowboxchild │ ╰── <child> ┊ ╰── [rubberband] GtkFlowBox uses a single CSS node with name flowbox. GtkFlowBoxChild uses a single CSS node with name flowboxchild. For rubberband selection, a subnode with name rubberband is used. # Accessibility GtkFlowBox uses the [enum@Gtk.AccessibleRole.grid] role, and GtkFlowBoxChild uses the [enum@Gtk.AccessibleRole.grid_cell] role.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • FlowBox ()

    Creates a GtkFlowBox.

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

    Wraps this handle as Orientable.

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

    Emitted when the user activates the @box. This is a keybinding signal.

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

    Emitted when a child has been activated by the user.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (FlowBox Self, FlowBoxChild Child).
    • @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. This is a keybinding signal. Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control the cursor programmatically. 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 (FlowBox 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.
  • 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 bindings for this signal is Ctrl-a.

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

    Emitted when the set of selected children changes. Use [method@Gtk.FlowBox.selected_foreach] or [method@Gtk.FlowBox.get_selected_children] to obtain the selected children.

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

    Emitted to toggle the selection of the child that has the focus. This is a keybinding signal. The default binding for this signal is Ctrl-Space.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (FlowBox 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 bindings for this signal is Ctrl-Shift-a.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (FlowBox 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.
  • setColumnspacing (int Value)

    The amount of horizontal space between two children.

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

    Determines whether all children should be allocated the same size.

    • @p Value is the new property value.
    • @r None.
  • setMaxchildrenperline (int Value)

    The maximum amount of children to request space for consecutively in the given orientation.

    • @p Value is the new property value.
    • @r None.
  • setMinchildrenperline (int Value)

    The minimum number of children to allocate consecutively in the given orientation. Setting the minimum children per line ensures that a reasonably small height will be requested for the overall minimum width of the box.

    • @p Value is the new property value.
    • @r None.
  • setRowspacing (int Value)

    The amount of vertical space between two children.

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

    The selection mode used by the flow box.

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

    Adds @child to the end of @self. If a sort function is set, the widget will actually be inserted at the calculated position. See also: [method@Gtk.FlowBox.insert].

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

    Returns whether children activate on single clicks.

  • get_child_at_index (int idx)

    Gets the nth child in the @box.

    • @p idx is the position of the child.
  • get_child_at_pos (int x, int y)

    Gets the child in the (@x, @y) position. Both @x and @y are assumed to be relative to the origin of @box.

    • @p x is the x coordinate of the child.
    • @p y is the y coordinate of the child.
  • get_column_spacing ()

    Gets the horizontal spacing.

  • get_homogeneous ()

    Returns whether the box is homogeneous.

  • get_max_children_per_line ()

    Gets the maximum number of children per line.

  • get_min_children_per_line ()

    Gets the minimum number of children per line.

  • get_row_spacing ()

    Gets the vertical spacing.

  • get_selected_children ()

    Creates a list of all selected children.

  • get_selection_mode ()

    Gets the selection mode of @box.

  • insert (object widget, int position)

    Inserts the @widget into @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 children in the @box, then the @widget will be appended to the end.
    • @p widget is the GtkWidget to add.
    • @p position is the position to insert @child in.
    • @r None.
  • invalidate_filter ()

    Updates the filtering for all children. Call this function when the 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 term, and the entry with the string has changed.

    • @r None.
  • invalidate_sort ()

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

    • @r None.
  • prepend (object child)

    Adds @child to the start of @self. If a sort function is set, the widget will actually be inserted at the calculated position. See also: [method@Gtk.FlowBox.insert].

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

    Removes a child from @box.

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

    Removes all children 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_child (object child)

    Selects a single child of @box, if the selection mode allows it.

    • @p child is a child of @box.
    • @r None.
  • set_activate_on_single_click (bool single)

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

    • @p single is %TRUE to emit child-activated on a single click.
    • @r None.
  • set_column_spacing (int spacing)

    Sets the horizontal space to add between children.

    • @p spacing is the spacing to use.
    • @r None.
  • set_hadjustment (object adjustment)

    Hooks up an adjustment to focus handling in @box. The adjustment is also used for autoscrolling during rubberband selection. See [method@Gtk.ScrolledWindow.get_hadjustment] for a typical way of obtaining the adjustment, and [method@Gtk.FlowBox.set_vadjustment] for setting the vertical adjustment. The adjustments have to be in pixel units and in the same coordinate system as the allocation for immediate children of the box.

    • @p adjustment is an adjustment which should be adjusted when the focus is moved among the descendents of @container.
    • @r None.
  • set_homogeneous (bool homogeneous)

    Sets whether or not all children of @box are given equal space in the box.

    • @p homogeneous is %TRUE to create equal allotments, %FALSE for variable allotments.
    • @r None.
  • set_max_children_per_line (int n_children)

    Sets the maximum number of children to request and allocate space for in

    • @box’s orientation. Setting the maximum number of children per line limits the overall natural size request to be no more than @n_children children long in the given orientation.
    • @p n_children is the maximum number of children per line.
    • @r None.
  • set_min_children_per_line (int n_children)

    Sets the minimum number of children to line up in @box’s orientation before flowing.

    • @p n_children is the minimum number of children per line.
    • @r None.
  • set_row_spacing (int spacing)

    Sets the vertical space to add between children.

    • @p spacing is the spacing to use.
    • @r None.
  • set_selection_mode (string mode)

    Sets how selection works in @box.

    • @p mode is the new selection mode.
    • @r None.
  • set_vadjustment (object adjustment)

    Hooks up an adjustment to focus handling in @box. The adjustment is also used for autoscrolling during rubberband selection. See [method@Gtk.ScrolledWindow.get_vadjustment] for a typical way of obtaining the adjustment, and [method@Gtk.FlowBox.set_hadjustment] for setting the horizontal adjustment. The adjustments have to be in pixel units and in the same coordinate system as the allocation for immediate children of the box.

    • @p adjustment is an adjustment which should be adjusted when the focus is moved among the descendents of @container.
    • @r None.
  • unselect_all ()

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

    • @r None.
  • unselect_child (object child)

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

    • @p child is a child of @box.
    • @r None.
  • selected_children ()

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

    • @r An Aussom list of elements.

class: FlowBoxActivatecursorchildCallback

[815:7] extends: object

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

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • FlowBoxActivatecursorchildCallback (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: FlowBoxTogglecursorchildCallback

[1170:7] extends: object

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

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • FlowBoxTogglecursorchildCallback (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: FlowBoxSelectedchildrenchangedCallback

[1100:7] extends: object

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

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • FlowBoxSelectedchildrenchangedCallback (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: FlowBoxMovecursorCallback

[956:7] extends: object

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

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • FlowBoxMovecursorCallback (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.

class: FlowBoxMeta

[1310:14] static extends: object

Generated metadata helpers for FlowBox class surfaces.

Methods

  • properties ()

    Returns property metadata for FlowBox.

    • @r A list.
  • signals ()

    Returns signal metadata for FlowBox.

    • @r A list.

class: FlowBoxSelectallCallback

[1029:7] extends: object

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

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • FlowBoxSelectallCallback (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: FlowBoxChildactivatedCallback

[885:7] extends: object

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

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • FlowBoxChildactivatedCallback (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, child, 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: FlowBoxUnselectallCallback

[1240:7] extends: object

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

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • FlowBoxUnselectallCallback (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.