Package org.gnome.gtk

Class FlowBox

java.lang.Object
All Implemented Interfaces:
Proxy, Accessible, Buildable, ConstraintTarget, Orientable

@Generated("io.github.jwharm.JavaGI") public class FlowBox extends Widget implements Accessible, Buildable, ConstraintTarget, Orientable
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 insert(org.gnome.gtk.Widget, int), and a GtkFlowBoxChild widget will automatically be inserted between the box and the widget.

Also see ListBox.

Shortcuts and Gestures
The following signals have default keybindings:

  • Gtk.FlowBox::move-cursor
  • Gtk.FlowBox::select-all
  • Gtk.FlowBox::toggle-cursor-child
  • 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 AccessibleRole.GRID role, and GtkFlowBoxChild uses the AccessibleRole.GRID_CELL role.