It derives from <GtkListBase>.
Presents a large dynamic grid of items.
<GtkGridView> 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.
<GtkGridView> 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 grid-view:enable-rubberband.
To learn more about the list widget framework, see the overview.
<GtkGridView> defines a set of built-in actions:
list.activate-item activates the item at given position by
emitting the the grid-view:activate signal.
gridview ├── child[.activatable] │ ├── child[.activatable] │ ┊ ╰── [rubberband]
<GtkGridView> uses a single CSS node with name
gridview. Each child uses a single CSS node with name
child. If the list-item:activatable property is set, the corresponding
row will have the .activatable style class. For rubberband
selection, a subnode with name rubberband is used.
<GtkGridView> uses the
Gtk.AccessibleRole.grid role, and the items use the
Gtk.AccessibleRole.grid_cell role.
Allow rubberband selection.
Its value is a boolean.
Set it with (set! (grid-view:enable-rubberband self) value).
Factory for populating list items.
The factory must be for configuring <GtkListItem>
objects.
Its value is a <GtkListItemFactory>, or
#f.
Set it with (set! (grid-view:factory self) value).
Maximum number of columns per row.
If this number is smaller than grid-view:min-columns, that value is used instead.
Its value is an unsigned 32-bit integer.
Set it with (set! (grid-view:max-columns self) value).
Minimum number of columns per row.
Its value is an unsigned 32-bit integer.
Set it with (set! (grid-view:min-columns self) value).
Model for the items displayed.
Its value is a <GtkSelectionModel>, or
#f.
Set it with (set! (grid-view:model self) value).
Activate rows on single click and select them on hover.
Its value is a boolean.
Set it with (set! (grid-view:single-click-activate self) value).
Behavior of the Tab key
Its value is a <GtkListTabBehavior> (or,
to set it, one of its symbols).
Set it with (set! (grid-view:tab-behavior self) value).
Returns whether rows can be selected by dragging with the mouse.
Passed: a <GtkGridView>.
Returned: a boolean.
#t if rubberband selection is enabled
Gets the factory that’s currently used to populate list items.
Passed: a <GtkGridView>.
Returned: a <GtkListItemFactory>, or
#f.
The factory in use
Gets the maximum number of columns that the grid will use.
Passed: a <GtkGridView>.
Returned: an unsigned 32-bit integer.
The maximum number of columns
Gets the minimum number of columns that the grid will use.
Passed: a <GtkGridView>.
Returned: an unsigned 32-bit integer.
The minimum number of columns
Gets the model that’s currently used to read the items displayed.
Passed: a <GtkGridView>.
Returned: a <GtkSelectionModel>, or
#f.
The model in use
Returns whether items will be activated on single click and selected on hover.
Passed: a <GtkGridView>.
Returned: a boolean.
#t if items are activated on single click
Gets the behavior set for the Tab key.
Passed: a <GtkGridView>.
Returned: a <GtkListTabBehavior>.
The behavior of the Tab key
Creates a new <GtkGridView> that uses the given
factory for mapping items to widgets.
The function takes ownership of the arguments, so you can write code like
grid_view = gtk_grid_view_new (create_model (),
gtk_builder_list_item_factory_new_from_resource ("/resource.ui"));
Passed, or left out: a <GtkSelectionModel>,
or #f.
the model to use
Passed, or left out: a
<GtkListItemFactory>, or #f.
The factory to populate items with
Returned: a <GtkWidget>.
a new <GtkGridView> using the given model
and factory
Scrolls to the item at the given position and performs the actions specified in flags.
This function works no matter if the gridview is shown or focused. If it isn’t, then the changes will take effect once that happens.
Passed: a <GtkGridView>.
The gridview to scroll in
Passed: an unsigned 32-bit integer.
position of the item. Must be less than the number of items in the view.
Passed: a <GtkListScrollFlags>, or a list
of its symbols, or one of them.
actions to perform
Passed, or left out: a <GtkScrollInfo>, or
#f.
details of how to perform the scroll operation or #f to scroll
into view
Sets whether selections can be changed by dragging with the mouse.
Passed: a <GtkGridView>.
Passed: a boolean.
#t to enable rubberband selection
Sets the <GtkListItemFactory> to use for
populating list items.
Passed: a <GtkGridView>.
Passed, or left out: a
<GtkListItemFactory>, or #f.
the factory to use
Sets the maximum number of columns to use.
This number must be at least 1.
If max-columns is smaller than the minimum set via
grid-view:set-min-columns, that
value is used instead.
Passed: a <GtkGridView>.
Passed: an unsigned 32-bit integer.
The maximum number of columns
Sets the minimum number of columns to use.
This number must be at least 1.
If min-columns is smaller than the minimum set via
grid-view:set-max-columns, that
value is ignored.
Passed: a <GtkGridView>.
Passed: an unsigned 32-bit integer.
The minimum number of columns
Sets the model to use.
This must be a <GtkSelectionModel>.
Passed: a <GtkGridView>.
Passed, or left out: a <GtkSelectionModel>,
or #f.
the model to use
Sets whether items should be activated on single click and selected on hover.
Passed: a <GtkGridView>.
Passed: a boolean.
#t to activate items on single click
Sets the behavior of the Tab and Shift+Tab keys.
Passed: a <GtkGridView>.
Passed: a <GtkListTabBehavior>, or one of
its symbols.
The desired tab behavior
Connect a handler with (connect object grid-view:activate
handler). It is called as (handler self position).
Emitted when a cell has been activated by the user, usually via activating the GtkGridView|list.activate-item action.
This allows for a convenient way to handle activation in a gridview. See
list-item:activatable for
details on how to use this signal.
Passed: a <GtkGridView>.
Passed: an unsigned 32-bit integer.
position of item to activate