It derives from <GtkWidget>.
Puts child widgets in a 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 flow-box:insert,
and a <GtkFlowBoxChild> widget will
automatically be inserted between the box and the widget.
Also see <GtkListBox>.
The following signals have default keybindings:
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.
<GtkFlowBox> uses the
Gtk.AccessibleRole.grid role, and
<GtkFlowBoxChild> uses the
Gtk.AccessibleRole.grid_cell role.
Whether to accept unpaired release events.
Its value is a boolean.
Set it with (set! (flow-box:accept-unpaired-release self) value).
Determines whether children can be activated with a single click, or require a double-click.
Its value is a boolean.
Set it with (set! (flow-box:activate-on-single-click self)
value).
The amount of horizontal space between two children.
Its value is an unsigned 32-bit integer.
Set it with (set! (flow-box:column-spacing self) value).
Determines whether all children should be allocated the same size.
Its value is a boolean.
Set it with (set! (flow-box:homogeneous self) value).
The maximum amount of children to request space for consecutively in the given orientation.
Its value is an unsigned 32-bit integer.
Set it with (set! (flow-box:max-children-per-line self) 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.
Its value is an unsigned 32-bit integer.
Set it with (set! (flow-box:min-children-per-line self) value).
The amount of vertical space between two children.
Its value is an unsigned 32-bit integer.
Set it with (set! (flow-box:row-spacing self) value).
The selection mode used by the flow box.
Its value is a <GtkSelectionMode> (or, to
set it, one of its symbols).
Set it with (set! (flow-box:selection-mode self) value).
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: flow-box:insert.
Passed: a <GtkFlowBox>.
a ‘GtkFlowBox
Passed: a <GtkWidget>.
the <GtkWidget> to add
Binds model to self.
If self was already bound to a model, that previous binding is destroyed.
The contents of self are cleared and then filled with widgets that
represent items from model. self is updated whenever
model changes. If model is #f, self is left
empty.
It is undefined to add or remove widgets directly (for example, with
flow-box:insert) while self 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.
Passed: a <GtkFlowBox>.
Passed: a <GListModel>, or #f.
the <GListModel> to be bound to self
Passed: a procedure.
a function that creates widgets for items
See GtkFlowBoxCreateWidgetFunc for
how it is called.
Not passed: guile-gi supplies it.
user data passed to create-widget-func
Not passed: guile-gi supplies it.
function for freeing user-data
See GDestroyNotify for how it is
called.
Returns whether children activate on single clicks.
Passed: a <GtkFlowBox>.
Returned: a boolean.
#t if children are activated on single click, #f otherwise
Gets the nth child in the self.
Passed: a <GtkFlowBox>.
Passed: a 32-bit integer.
the position of the child
Returned: a <GtkFlowBoxChild>, or #f.
the child widget, which will always be a
<GtkFlowBoxChild> or #f in case no
child widget with the given index exists.
Gets the child in the (x, y) position.
Both x and y are assumed to be relative to the origin of self.
Passed: a <GtkFlowBox>.
Passed: a 32-bit integer.
the x coordinate of the child
Passed: a 32-bit integer.
the y coordinate of the child
Returned: a <GtkFlowBoxChild>, or #f.
the child widget, which will always be a
<GtkFlowBoxChild> or #f in case no
child widget exists for the given x and y coordinates.
Gets the horizontal spacing.
Passed: a <GtkFlowBox>.
Returned: an unsigned 32-bit integer.
the horizontal spacing
Returns whether the box is homogeneous.
Passed: a <GtkFlowBox>.
Returned: a boolean.
#t if the box is homogeneous.
Gets the maximum number of children per line.
Passed: a <GtkFlowBox>.
Returned: an unsigned 32-bit integer.
the maximum number of children per line
Gets the minimum number of children per line.
Passed: a <GtkFlowBox>.
Returned: an unsigned 32-bit integer.
the minimum number of children per line
Gets the vertical spacing.
Passed: a <GtkFlowBox>.
Returned: an unsigned 32-bit integer.
the vertical spacing
Creates a list of all selected children.
Passed: a <GtkFlowBox>.
Returned: a list, each a <GtkFlowBoxChild>.
A GList containing the <GtkWidget> for each
selected child. Free with g_list_free() when done.
Gets the selection mode of self.
Passed: a <GtkFlowBox>.
Returned: a <GtkSelectionMode>.
Inserts the widget into self 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 self, then the widget will be appended to the end.
Passed: a <GtkFlowBox>.
Passed: a <GtkWidget>.
the <GtkWidget> to add
Passed: a 32-bit integer.
the position to insert child in
Updates the filtering for all children.
Call this function when the result of the filter function on the self 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.
Passed: a <GtkFlowBox>.
Updates the sorting for all children.
Call this when the result of the sort function on self is changed due to an external factor.
Passed: a <GtkFlowBox>.
Creates a <GtkFlowBox>.
Returned: a <GtkWidget>.
a new <GtkFlowBox>
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: flow-box:insert.
Passed: a <GtkFlowBox>.
a ‘GtkFlowBox
Passed: a <GtkWidget>.
the <GtkWidget> to add
Removes a child from self.
Passed: a <GtkFlowBox>.
Passed: a <GtkWidget>.
the child widget to remove
Removes all children from self.
This function does nothing if self is backed by a model.
Passed: a <GtkFlowBox>.
Select all children of self, if the selection mode allows it.
Passed: a <GtkFlowBox>.
Selects a single child of self, if the selection mode allows it.
Passed: a <GtkFlowBox>.
Passed: a <GtkFlowBoxChild>.
a child of self
Calls a function for each selected child.
Note that the selection cannot be modified from within this function.
Passed: a <GtkFlowBox>.
Passed: a procedure.
the function to call for each selected child
See GtkFlowBoxForeachFunc for how it is
called.
Not passed: guile-gi supplies it.
user data to pass to the function
If single is #t, children will be activated when you click
on them, otherwise you need to double-click.
Passed: a <GtkFlowBox>.
Passed: a boolean.
#t to emit child-activated on a single click
Sets the horizontal space to add between children.
Passed: a <GtkFlowBox>.
Passed: an unsigned 32-bit integer.
the spacing to use
By setting a filter function on the self 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
flow-box-child:changed) or when
flow-box:invalidate-filter is
called.
Note that using a filter function is incompatible with using a model
(see flow-box:bind-model).
Passed: a <GtkFlowBox>.
Passed, or left out: a procedure, or #f.
callback that lets you filter which children to show
See GtkFlowBoxFilterFunc for how it is
called.
Not passed: guile-gi supplies it.
user data passed to filter-func
Not passed: guile-gi supplies it.
destroy notifier for user-data
See GDestroyNotify for how it is
called.
Hooks up an adjustment to focus handling in self.
The adjustment is also used for autoscrolling during rubberband
selection. See scrolled-window:get-hadjustment for a typical way of
obtaining the adjustment, and flow-box: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.
Passed: a <GtkFlowBox>.
Passed: a <GtkAdjustment>.
an adjustment which should be adjusted when the focus is moved among the descendents of container
Sets whether or not all children of self are given equal space in the box.
Passed: a <GtkFlowBox>.
Passed: a boolean.
#t to create equal allotments, #f for variable allotments
Sets the maximum number of children to request and allocate space for in self’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.
Passed: a <GtkFlowBox>.
Passed: an unsigned 32-bit integer.
the maximum number of children per line
Sets the minimum number of children to line up in self’s orientation before flowing.
Passed: a <GtkFlowBox>.
Passed: an unsigned 32-bit integer.
the minimum number of children per line
Sets the vertical space to add between children.
Passed: a <GtkFlowBox>.
Passed: an unsigned 32-bit integer.
the spacing to use
Sets how selection works in self.
Passed: a <GtkFlowBox>.
Passed: a <GtkSelectionMode>, or one of its
symbols.
the new selection mode
By setting a sort function on the self, 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
flow-box-child:changed) and when
flow-box:invalidate-sort is
called.
Note that using a sort function is incompatible with using a model (see
flow-box:bind-model).
Passed: a <GtkFlowBox>.
Passed, or left out: a procedure, or #f.
the sort function
See GtkFlowBoxSortFunc for how it is
called.
Not passed: guile-gi supplies it.
user data passed to sort-func
Not passed: guile-gi supplies it.
destroy notifier for user-data
See GDestroyNotify for how it is
called.
Hooks up an adjustment to focus handling in self.
The adjustment is also used for autoscrolling during rubberband
selection. See scrolled-window:get-vadjustment for a typical way of
obtaining the adjustment, and flow-box: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.
Passed: a <GtkFlowBox>.
Passed: a <GtkAdjustment>.
an adjustment which should be adjusted when the focus is moved among the descendents of container
Unselect all children of self, if the selection mode allows it.
Passed: a <GtkFlowBox>.
Unselects a single child of self, if the selection mode allows it.
Passed: a <GtkFlowBox>.
Passed: a <GtkFlowBoxChild>.
a child of self
Connect a handler with (connect object
flow-box:activate-cursor-child handler). It is called as
(handler self).
Emitted when the user activates the box.
This is a keybinding signal.
Passed: a <GtkFlowBox>.
Connect a handler with (connect object flow-box:child-activated
handler). It is called as (handler self child).
Emitted when a child has been activated by the user.
Passed: a <GtkFlowBox>.
Passed: a <GtkFlowBoxChild>.
the child that is activated
Connect a handler with (connect object flow-box:move-cursor
handler). It is called as (handler self step count extend
modify) ⇒ %return.
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.
Passed: a <GtkFlowBox>.
Passed: a <GtkMovementStep>.
the granularity of the move, as a
<GtkMovementStep>
Passed: a 32-bit integer.
the number of step units to move
Passed: a boolean.
whether to extend the selection
Passed: a boolean.
whether to modify the selection
Returned: a boolean.
#t to stop other handlers from being invoked for the event.
#f to propagate the event further.
Connect a handler with (connect object flow-box:select-all
handler). It is called as (handler self).
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.
Passed: a <GtkFlowBox>.
Connect a handler with (connect object
flow-box:selected-children-changed handler). It is called as
(handler self).
Emitted when the set of selected children changes.
Use flow-box:selected-foreach or
flow-box:get-selected-children to obtain the
selected children.
Passed: a <GtkFlowBox>.
Connect a handler with (connect object
flow-box:toggle-cursor-child handler). It is called as (handler
self).
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.
Passed: a <GtkFlowBox>.
Connect a handler with (connect object flow-box:unselect-all
handler). It is called as (handler self).
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.
Passed: a <GtkFlowBox>.