Package: gtk

Class gtk-flow-box

Superclasses

gtk-container, gtk-widget, gtk-buildable, gtk-orientable, g-object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

None

Direct Slots

activate-on-single-click
The activate-on-single-click property of type :boolean (Read / Write)
Determines whether children can be activated with a single click, or require a double click.
Default value: true
column-spacing
The column-spacing property of type :uint (Read / Write)
The amount of horizontal space between two children.
Default value: 0
homogeneous
The homogeneous property of type :boolean (Read / Write)
Determines whether all children should be allocated the same size.
Default value: false
max-children-per-line
The max-children-per-line property of type :uint (Read / Write)
The maximum amount of children to request space for consecutively in the given orientation.
Default value: 7
min-children-per-line
The min-children-per-line property of type :uint (Read / Write)
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.
Default value: 0
row-spacing
The row-spacing property of type :uint (Read / Write)
The amount of vertical space between two children.
Default value: 0
selection-mode
The selection-mode property of type gtk-selection-mode (Read / Write)
The selection mode used by the flow box.
Default value: :single

Details

A gtk-flow-box widget positions child widgets in sequence according to its orientation.



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 gtk-flow-box widget 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 gtk-scrolled-window widget to enable that.

The children of a gtk-flow-box widget can be dynamically sorted and filtered.

Although a gtk-flow-box widget must have only gtk-flow-box-child children, you can add any kind of widget to it via the gtk-container-add function, and a gtk-flow-box-child widget will automatically be inserted between the box and the widget.

Also see the gtk-list-box widget.

CSS nodes

  flowbox
  ├── flowboxchild
  │   ╰── <child>
  ├── flowboxchild
  │   ╰── <child>
  │
   ╰── [rubberband]    
The gtk-flow-box implementation uses a single CSS node with name flowbox. The gtk-flow-box-child implementation uses a single CSS node with name flowboxchild. For rubberband selection, a subnode with name rubberband is used.

Signal Details

The "activate-cursor-child" signal
 lambda (flowbox)    :action      
The signal is a keybinding signal which gets emitted when the user activates the flow box.
flowbox
The gtk-flow-box widget on which the signal is emitted.
The "child-activated" signal
 lambda (flowbox child)    :run-last      
The signal is emitted when a child has been activated by the user.
flowbox
The gtk-flow-box widget on which the signal is emitted.
child
The gtk-flow-box-child widget that is activated.
The "move-cursor" signal
 lambda (flowbox step count)    :action      
The signal is a keybinding signal which gets emitted when the user initiates a cursor movement. Applications should not connect to it, but may emit it with the g-signal-emit function 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 modifer does not. There are too many key combinations to list them all here. Arrow keys move by individual children. Home/End keys move to the ends of the box. PageUp/PageDown keys move vertically by pages.
flowbox
The gtk-flow-box widget on which the signal is emitted.
step
The granularity to the move, as a value of the gtk-movement-step enumeration.
count
An integer with the number of step units to move.
Returns
True to stop other handlers from being invoked for the event. False to propagate the event further.
The "select-all" signal
 lambda (flowbox)    :action      
The signal is a keybinding signal which gets emitted to select all children of the box, if the selection mode permits it. The default bindings for this signal is the Ctrl-a key.
flowbox
The gtk-flow-box widget on which the signal is emitted.
The "selected-children-changed" signal
 lambda (flowbox)    :run-first      
The signal is emitted when the set of selected children changes. Use the gtk-flow-box-selected-foreach or gtk-flow-box-selected-children functions to obtain the selected children.
box
The gtk-flow-box on which the signal is emitted.
The "toggle-cursor-child" signal
 lambda (flowbox)    :action      
The signal is a keybinding signal which toggles the selection of the child that has the focus. The default binding for this signal is the Ctrl-Space key.
flowbox
The gtk-flow-box widget on which the signal is emitted.
The "unselect-all" signal
 lambda (flowbox)    :action      
The signal is a keybinding signal which gets emitted to unselect all children of the box, if the selection mode permits it. The default bindings for this signal is the Ctrl-Shift-a key.
flowbox
The gtk-flow-box widget on which the signal is emitted.
 

Slot Access Functions

Inherited Slot Access Functions

See also

*2021-12-15