FlowBoxProtocol

public protocol FlowBoxProtocol : OrientableProtocol, WidgetProtocol

A GtkFlowBox puts child widgets in reflowing grid.

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 [methodGtk.FlowBox.insert], and a GtkFlowBoxChild widget will automatically be inserted between the box and the widget.

Also see [classGtk.ListBox].

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 GTK_ACCESSIBLE_ROLE_GRID role, and GtkFlowBoxChild uses the GTK_ACCESSIBLE_ROLE_GRID_CELL role.

The FlowBoxProtocol protocol exposes the methods and properties of an underlying GtkFlowBox 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 FlowBox. Alternatively, use FlowBoxRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkFlowBox instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkFlowBox instance.

    Default Implementation

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

    Declaration

    Swift

    var flow_box_ptr: UnsafeMutablePointer<GtkFlowBox>! { get }
  • Required Initialiser for types conforming to FlowBoxProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

FlowBox Class

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

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: FlowBoxPropertyName, 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 FlowBox property

    Declaration

    Swift

    @inlinable
    func get(property: FlowBoxPropertyName) -> 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 FlowBox property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

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

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

FlowBox signals

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

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: FlowBoxSignalName, 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 FlowBoxSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: FlowBoxSignalName, 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)

  • Emitted when the user activates the box.

    This is a keybinding signal.

    Note

    This represents the underlying activate-cursor-child signal

    Declaration

    Swift

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

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

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

  • activateCursorChildSignal Extension method

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

    Declaration

    Swift

    static var activateCursorChildSignal: FlowBoxSignalName { get }
  • Emitted when a child has been activated by the user.

    Note

    This represents the underlying child-activated signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onChildActivated(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ child: FlowBoxChildRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    child

    the child that is activated

    handler

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

  • childActivatedSignal Extension method

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

    Declaration

    Swift

    static var childActivatedSignal: FlowBoxSignalName { get }
  • onMoveCursor(flags:handler:) Extension method

    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.

    • <kbd>←</kbd>, <kbd>→</kbd>, <kbd>↑</kbd>, <kbd>↓</kbd> move by individual children
    • <kbd>Home</kbd>, <kbd>End</kbd> move to the ends of the box
    • <kbd>PgUp</kbd>, <kbd>PgDn</kbd> move vertically by pages

    Note

    This represents the underlying move-cursor signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onMoveCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ step: MovementStep, _ count: Int, _ extend: Bool, _ modify: Bool) -> Bool) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    step

    the granularity fo the move, as a GtkMovementStep

    count

    the number of step units to move

    extend

    whether to extend the selection

    modify

    whether to modify the selection

    handler

    true to stop other handlers from being invoked for the event. false to propagate the event further. 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: FlowBoxSignalName { 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 bindings 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: FlowBoxRef) -> 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: FlowBoxSignalName { get }
  • Emitted when the set of selected children changes.

    Use [methodGtk.FlowBox.selected_foreach] or [methodGtk.FlowBox.get_selected_children] to obtain the selected children.

    Note

    This represents the underlying selected-children-changed signal

    Declaration

    Swift

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

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

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

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

    Declaration

    Swift

    static var selectedChildrenChangedSignal: FlowBoxSignalName { get }
  • Emitted to toggle the selection of the child that has the focus.

    This is a keybinding signal.

    The default binding for this signal is <kbd>Ctrl</kbd>-<kbd>Space</kbd>.

    Note

    This represents the underlying toggle-cursor-child signal

    Declaration

    Swift

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

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

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

  • toggleCursorChildSignal Extension method

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

    Declaration

    Swift

    static var toggleCursorChildSignal: FlowBoxSignalName { get }
  • 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 <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: FlowBoxRef) -> 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: FlowBoxSignalName { 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: FlowBoxRef, _ 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: FlowBoxSignalName { 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: FlowBoxRef, _ 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: FlowBoxSignalName { 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::column-spacing signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyColumnSpacing(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ 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 notifyColumnSpacing signal is emitted

  • notifyColumnSpacingSignal Extension method

    Typed notify::column-spacing signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyColumnSpacingSignal: FlowBoxSignalName { 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::homogeneous signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyHomogeneous(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ 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 notifyHomogeneous signal is emitted

  • notifyHomogeneousSignal Extension method

    Typed notify::homogeneous signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyHomogeneousSignal: FlowBoxSignalName { 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::max-children-per-line signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyMaxChildrenPerLine(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ 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 notifyMaxChildrenPerLine signal is emitted

  • Typed notify::max-children-per-line signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyMaxChildrenPerLineSignal: FlowBoxSignalName { 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::min-children-per-line signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyMinChildrenPerLine(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ 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 notifyMinChildrenPerLine signal is emitted

  • Typed notify::min-children-per-line signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyMinChildrenPerLineSignal: FlowBoxSignalName { 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::row-spacing signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyRowSpacing(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FlowBoxRef, _ 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 notifyRowSpacing signal is emitted

  • notifyRowSpacingSignal Extension method

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

    Declaration

    Swift

    static var notifyRowSpacingSignal: FlowBoxSignalName { 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: FlowBoxRef, _ 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: FlowBoxSignalName { get }

FlowBox Class: FlowBoxProtocol extension (methods and fields)

  • 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.FlowBox.insert]) while box is bound to a model.

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

    Declaration

    Swift

    @inlinable
    func bind(model: GIO.ListModelRef? = nil, createWidgetFunc: GtkFlowBoxCreateWidgetFunc?, 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.FlowBox.insert]) while box is bound to a model.

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

    Declaration

    Swift

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

    Returns whether children activate on single clicks.

    Declaration

    Swift

    @inlinable
    func getActivateOnSingleClick() -> Bool
  • getChildAtIndex(idx:) Extension method

    Gets the nth child in the box.

    Declaration

    Swift

    @inlinable
    func getChildAtIndex(idx: Int) -> FlowBoxChildRef!
  • getChildAtPos(x:y:) Extension method

    Gets the child in the (x, y) position.

    Both x and y are assumed to be relative to the origin of box.

    Declaration

    Swift

    @inlinable
    func getChildAtPos(x: Int, y: Int) -> FlowBoxChildRef!
  • getColumnSpacing() Extension method

    Gets the horizontal spacing.

    Declaration

    Swift

    @inlinable
    func getColumnSpacing() -> Int
  • getHomogeneous() Extension method

    Returns whether the box is homogeneous.

    Declaration

    Swift

    @inlinable
    func getHomogeneous() -> Bool
  • getMaxChildrenPerLine() Extension method

    Gets the maximum number of children per line.

    Declaration

    Swift

    @inlinable
    func getMaxChildrenPerLine() -> Int
  • getMinChildrenPerLine() Extension method

    Gets the minimum number of children per line.

    Declaration

    Swift

    @inlinable
    func getMinChildrenPerLine() -> Int
  • getRowSpacing() Extension method

    Gets the vertical spacing.

    Declaration

    Swift

    @inlinable
    func getRowSpacing() -> Int
  • getSelectedChildren() Extension method

    Creates a list of all selected children.

    Declaration

    Swift

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

    Gets the selection mode of box.

    Declaration

    Swift

    @inlinable
    func getSelectionMode() -> GtkSelectionMode
  • insert(widget:position:) Extension method

    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.

    Declaration

    Swift

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

    Updates the filtering for all children.

    Call this function when the result of the filter function on the box is changed due ot 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.

    Declaration

    Swift

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

    Updates the sorting for all children.

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

    Declaration

    Swift

    @inlinable
    func invalidateSort()
  • remove(widget:) Extension method

    Removes a child from box.

    Declaration

    Swift

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

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

    Declaration

    Swift

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

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

    Declaration

    Swift

    @inlinable
    func select<FlowBoxChildT>(child: FlowBoxChildT) where FlowBoxChildT : FlowBoxChildProtocol
  • 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: GtkFlowBoxForeachFunc?, data: gpointer! = nil)
  • If single is true, children will be activated when you click on them, otherwise you need to double-click.

    Declaration

    Swift

    @inlinable
    func setActivateOnSingleClick(single: Bool)
  • setColumn(spacing:) Extension method

    Sets the horizontal space to add between children.

    Declaration

    Swift

    @inlinable
    func setColumn(spacing: Int)
  • By setting a filter function on the box one can decide dynamically which of the children to show.

    For instance, to implement a search function that only shows the children matching the search terms.

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

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

    Declaration

    Swift

    @inlinable
    func set(filterFunc: GtkFlowBoxFilterFunc? = nil, userData: gpointer! = nil, destroy: GDestroyNotify?)
  • setHadjustment(adjustment:) Extension method

    Hooks up an adjustment to focus handling in box.

    The adjustment is also used for autoscrolling during rubberband selection. See [methodGtk.ScrolledWindow.get_hadjustment] for a typical way of obtaining the adjustment, and [methodGtk.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.

    Declaration

    Swift

    @inlinable
    func setHadjustment<AdjustmentT>(adjustment: AdjustmentT) where AdjustmentT : AdjustmentProtocol
  • set(homogeneous:) Extension method

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

    Declaration

    Swift

    @inlinable
    func set(homogeneous: Bool)
  • 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.

    Declaration

    Swift

    @inlinable
    func setMaxChildrenPerLine(nChildren: Int)
  • Sets the minimum number of children to line up in box’s orientation before flowing.

    Declaration

    Swift

    @inlinable
    func setMinChildrenPerLine(nChildren: Int)
  • setRow(spacing:) Extension method

    Sets the vertical space to add between children.

    Declaration

    Swift

    @inlinable
    func setRow(spacing: Int)
  • setSelection(mode:) Extension method

    Sets how selection works in box.

    Declaration

    Swift

    @inlinable
    func setSelection(mode: GtkSelectionMode)
  • By setting a sort function on the box, one can dynamically reorder the children of the box, based on the contents of the children.

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

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

    Declaration

    Swift

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

    Hooks up an adjustment to focus handling in box.

    The adjustment is also used for autoscrolling during rubberband selection. See [methodGtk.ScrolledWindow.get_vadjustment] for a typical way of obtaining the adjustment, and [methodGtk.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.

    Declaration

    Swift

    @inlinable
    func setVadjustment<AdjustmentT>(adjustment: AdjustmentT) where AdjustmentT : AdjustmentProtocol
  • unselectAll() Extension method

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

    Declaration

    Swift

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

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

    Declaration

    Swift

    @inlinable
    func unselect<FlowBoxChildT>(child: FlowBoxChildT) where FlowBoxChildT : FlowBoxChildProtocol
  • activateOnSingleClick Extension method

    Returns whether children activate on single clicks.

    Declaration

    Swift

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

    Gets the horizontal spacing.

    Declaration

    Swift

    @inlinable
    var columnSpacing: Int { get nonmutating set }
  • homogeneous Extension method

    Determines whether all children should be allocated the same size.

    Declaration

    Swift

    @inlinable
    var homogeneous: Bool { get nonmutating set }
  • maxChildrenPerLine Extension method

    Gets the maximum number of children per line.

    Declaration

    Swift

    @inlinable
    var maxChildrenPerLine: Int { get nonmutating set }
  • minChildrenPerLine Extension method

    Gets the minimum number of children per line.

    Declaration

    Swift

    @inlinable
    var minChildrenPerLine: Int { get nonmutating set }
  • rowSpacing Extension method

    Gets the vertical spacing.

    Declaration

    Swift

    @inlinable
    var rowSpacing: Int { get nonmutating set }
  • selectedChildren Extension method

    Creates a list of all selected children.

    Declaration

    Swift

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

    Gets the selection mode of box.

    Declaration

    Swift

    @inlinable
    var selectionMode: GtkSelectionMode { get nonmutating set }