Package: gtk

Class gtk:grid-view

Superclasses

Documented Subclasses

None

Direct Slots

enable-rubberband
The enable-rubberband property of type :boolean (Read / Write)
Allow rubberband selection.
Default value: false
factory
The factory property of type gtk:list-item-factory (Read / Write)
Factory for populating list items.
max-columns
The max-columns property of type :uint (Read / Write)
If this number is smaller than the min-columns property, that value is used instead.
Allowed values: >= 1
Default value: 7
min-columns
The min-columns property of type :uint (Read / Write)
Minimum number of columns per row.
Allowed values: >= 1
Default value: 1
model
The model property of type gtk:selection-model (Read / Write)
Model for the items displayed.
single-click-activate
The single-click-activate property of type :boolean (Read / Write)
Activate rows on single click and select them on hover.
Default value: false
tab-behavior
The tab-beavior property of type gtk:list-tab-behavior (Read / Write)
Behavior of the Tab key.
Default value: :all

Details

The gtk:grid-view widget is a widget to present a view into a large dynamic grid of items. The gtk:grid-view widget uses its factory to generate one child widget for each visible item and shows them in a grid. The orientation of the grid view determines if the grid reflows vertically or horizontally.

The gtk:grid-view widget allows the user to select items according to the selection characteristics of the model. For models that allow multiple selected items, it is possible to turn on rubberband selection, using the enable-rubberband property.

To learn more about the list widget framework, see the list widget overview.

CSS nodes

gridview
├── child
│
├── child
│
┊
╰── [rubberband]    
The gtk:grid-view implementation uses a single CSS node with name gridview. Each child uses a single CSS node with name child. If the activatable property is set, the corresponding row will have the .activatable style class. For rubberband selection, a subnode with name rubberband is used.

Accessibility

The gtk:grid-view implementation uses the :grid role, and the items use the :grid-cell role from the gtk:accessible-role enumeration.

Signal Details

The "activate" signal
lambda (gridview position)    :run-last      
gridview
The gtk:grid-view widget.
position
An unsigned integer with the position of the item to activate.
The signal is emitted when a cell has been activated by the user. This allows for a convenient way to handle activation in a grid view. See the activatable property for details on how to use this signal.
 

Returned by

Slot Access Functions

Inherited Slot Access Functions

See also

2024-11-28