GridView

GtkGridView 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.

CSS nodes

gridview
├── child
│
├── child
│
┊
╰── [rubberband]

GtkGridView uses a single CSS node with name gridview. Each child uses a single CSS node with name child. For rubberband selection, a subnode with name rubberband is used.

Accessibility

GtkGridView uses the %GTK_ACCESSIBLE_ROLE_GRID role, and the items use the %GTK_ACCESSIBLE_ROLE_GRID_CELL role.

Constructors

this
this(GtkGridView* gtkGridView, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(SelectionModelIF model, ListItemFactory factory)

Creates a new GtkGridView that uses the given @factory for mapping items to widgets.

Members

Functions

addOnActivate
gulong addOnActivate(void delegate(uint, GridView) dlg, ConnectFlags connectFlags)

Emitted when a cell has been activated by the user, usually via activating the GtkGridView|list.activate-item action.

getEnableRubberband
bool getEnableRubberband()

Returns whether rows can be selected by dragging with the mouse.

getFactory
ListItemFactory getFactory()

Gets the factory that's currently used to populate list items.

getGridViewStruct
GtkGridView* getGridViewStruct(bool transferOwnership)

Get the main Gtk struct

getMaxColumns
uint getMaxColumns()

Gets the maximum number of columns that the grid will use.

getMinColumns
uint getMinColumns()

Gets the minimum number of columns that the grid will use.

getModel
SelectionModelIF getModel()

Gets the model that's currently used to read the items displayed.

getSingleClickActivate
bool getSingleClickActivate()

Returns whether items will be activated on single click and selected on hover.

getStruct
void* getStruct()

the main Gtk struct as a void*

setEnableRubberband
void setEnableRubberband(bool enableRubberband)

Sets whether selections can be changed by dragging with the mouse.

setFactory
void setFactory(ListItemFactory factory)

Sets the GtkListItemFactory to use for populating list items.

setMaxColumns
void setMaxColumns(uint maxColumns)

Sets the maximum number of columns to use.

setMinColumns
void setMinColumns(uint minColumns)

Sets the minimum number of columns to use.

setModel
void setModel(SelectionModelIF model)

Sets the imodel to use.

setSingleClickActivate
void setSingleClickActivate(bool singleClickActivate)

Sets whether items should be activated on single click and selected on hover.

Static functions

getType
GType getType()

Variables

gtkGridView
GtkGridView* gtkGridView;

the main Gtk struct

Inherited Members

From ListBase

gtkListBase
GtkListBase* gtkListBase;

the main Gtk struct

getListBaseStruct
GtkListBase* getListBaseStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

__anonymous
mixin OrientableT!(GtkListBase)
Undocumented in source.
__anonymous
mixin ScrollableT!(GtkListBase)
Undocumented in source.
getType
GType getType()

Meta