Basics
Guides
API Reference
Basics
Guides
API Reference
[494:7] extends: object
Generated low-level callback wrapper for GIR callback activate.
GridViewActivateCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, position, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[564:14] static extends: object
Generated metadata helpers for GridView class surfaces.
properties ()
Returns property metadata for
GridView.
A list.signals ()
Returns signal metadata for
GridView.
A list.[30:7] extends: object
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
[property@Gtk.GridView:enable-rubberband]. To learn more about the list
widget framework, see the overview. # Actions
GtkGridView defines a set of built-in actions: - list.activate-item
activates the item at given position by emitting the the
[signal@Gtk.GridView::activate] signal. # CSS nodes 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 [property@Gtk.ListItem:activatable]
property is set, the corresponding row will have the .activatable style
class. For rubberband selection, a subnode with name rubberband is used. #
Accessibility GtkGridView uses the [enum@Gtk.AccessibleRole.grid] role, and
the items use the [enum@Gtk.AccessibleRole.grid_cell] role.
GridView (model = null, factory = null)
Creates a new
GtkGridViewthat uses the given @factory for mapping items to widgets. The function takes ownership of the arguments, so you can write code likec grid_view = gtk_grid_view_new (create_model (), gtk_builder_list_item_factory_new_from_resource ("/resource.ui"));
model is the model to use.factory is The factory to populate items with.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asListBase ()
Wraps this handle as
ListBase.
A ListBase object.asAccessible ()
Wraps this handle as
Accessible.
A Accessible object.asBuildable ()
Wraps this handle as
Buildable.
A Buildable object.asConstraintTarget ()
Wraps this handle as
ConstraintTarget.
A ConstraintTarget object.asOrientable ()
Wraps this handle as
Orientable.
A Orientable object.asScrollable ()
Wraps this handle as
Scrollable.
A Scrollable object.connectSignal (string Name, CallbackObj)
Connects one generated callback wrapper to a named signal.
Name is the signal name.CallbackObj is the generated callback wrapper to connect.The connected handler id.disconnectSignalHandler (int HandlerId)
Disconnects one retained signal handler id.
HandlerId is the signal handler id to disconnect.None.setOnActivate (callback Fn, UserData = null)
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 [property@Gtk.ListItem:activatable] for details on how to use this signal.
Fn is the Aussom callback.Fn is called with (GridView Self, int Position).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setEnablerubberband (bool Value)
Allow rubberband selection.
Value is the new property value.None.setFactory (object Value)
Factory for populating list items. The factory must be for configuring [class@Gtk.ListItem] objects.
Value is the new property value.None.setMaxcolumns (int Value)
Maximum number of columns per row. If this number is smaller than [property@Gtk.GridView:min-columns], that value is used instead.
Value is the new property value.None.setMincolumns (int Value)
Minimum number of columns per row.
Value is the new property value.None.setModel (object Value)
Model for the items displayed.
Value is the new property value.None.setSingleclickactivate (bool Value)
Activate rows on single click and select them on hover.
Value is the new property value.None.setTabbehavior (string Value)
Behavior of the Tab key
Value is the new property value.None.get_enable_rubberband ()
Returns whether rows can be selected by dragging with the mouse.
get_factory ()
Gets the factory that's currently used to populate list items.
get_max_columns ()
Gets the maximum number of columns that the grid will use.
get_min_columns ()
Gets the minimum number of columns that the grid will use.
get_model ()
Gets the model that's currently used to read the items displayed.
get_single_click_activate ()
Returns whether items will be activated on single click and selected on hover.
get_tab_behavior ()
Gets the behavior set for the Tab key.
scroll_to (int pos, string flags, object scroll)
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.
pos is position of the item. Must be less than the number of items in the view..flags is actions to perform.scroll is details of how to perform the scroll operation or %NULL to scroll into view.None.set_enable_rubberband (bool enable_rubberband)
Sets whether selections can be changed by dragging with the mouse.
enable_rubberband is %TRUE to enable rubberband selection.None.set_factory (object factory)
Sets the
GtkListItemFactoryto use for populating list items.
factory is the factory to use.None.set_max_columns (int max_columns)
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 [method@Gtk.GridView.set_min_columns], that value is used instead.
max_columns is The maximum number of columns.None.set_min_columns (int min_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 [method@Gtk.GridView.set_max_columns], that value is ignored.
min_columns is The minimum number of columns.None.set_model (object model)
Sets the model to use. This must be a [iface@Gtk.SelectionModel].
model is the model to use.None.set_single_click_activate (bool single_click_activate)
Sets whether items should be activated on single click and selected on hover.
single_click_activate is %TRUE to activate items on single click.None.set_tab_behavior (string tab_behavior)
Sets the behavior of the Tab and Shift+Tab keys.
tab_behavior is The desired tab behavior.None.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.