gtk.grid_view
Module for [GridView] class
Types 3
gtk.grid_view.GridView presents a large dynamic grid of items.
gtk.grid_view.GridView 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.
gtk.grid_view.GridView 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 gtk.grid_view.GridView.enableRubberband.
To learn more about the list widget framework, see the overview.
CSS nodes
gridview
├── child[.activatable]
│
├── child[.activatable]
│
┊
╰── [rubberband]gtk.grid_view.GridView uses a single CSS node with name gridview. Each child uses a single CSS node with name child. If the gtk.list_item.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
gtk.grid_view.GridView uses the gtk.types.AccessibleRole.Grid role, and the items use the gtk.types.AccessibleRole.GridCell role.
GridViewGidBuilder builder() static nothrowGet builder for [gtk.grid_view.GridView] Returns: New builder objectbool enableRubberband() @property nothrowGet `enableRubberband` property. Returns: Allow rubberband selection.void enableRubberband(bool propval) @property nothrowSet `enableRubberband` property. Params: propval = Allow rubberband selection.gtk.list_item_factory.ListItemFactory factory() @property nothrowGet `factory` property. Returns: Factory for populating list items.void factory(gtk.list_item_factory.ListItemFactory propval) @property nothrowSet `factory` property. Params: propval = Factory for populating list items.uint maxColumns() @property nothrowGet `maxColumns` property. Returns: Maximum number of columns per row.void maxColumns(uint propval) @property nothrowSet `maxColumns` property. Params: propval = Maximum number of columns per row.uint minColumns() @property nothrowGet `minColumns` property. Returns: Minimum number of columns per row.void minColumns(uint propval) @property nothrowSet `minColumns` property. Params: propval = Minimum number of columns per row.gtk.selection_model.SelectionModel model() @property nothrowGet `model` property. Returns: Model for the items displayed.void model(gtk.selection_model.SelectionModel propval) @property nothrowSet `model` property. Params: propval = Model for the items displayed.bool singleClickActivate() @property nothrowGet `singleClickActivate` property. Returns: Activate rows on single click and select them on hover.void singleClickActivate(bool propval) @property nothrowSet `singleClickActivate` property. Params: propval = Activate rows on single click and select them on hover.gtk.types.ListTabBehavior tabBehavior() @property nothrowGet `tabBehavior` property. Returns: Behavior of the <kbd>Tab</kbd> keyvoid tabBehavior(gtk.types.ListTabBehavior propval) @property nothrowSet `tabBehavior` property. Params: propval = Behavior of the <kbd>Tab</kbd> keybool getEnableRubberband() nothrowReturns whether rows can be selected by dragging with the mouse. Returns: true if rubberband selection is enabledgtk.list_item_factory.ListItemFactory getFactory() nothrowGets the factory that's currently used to populate list items. Returns: The factory in useuint getMaxColumns() nothrowGets the maximum number of columns that the grid will use. Returns: The maximum number of columnsuint getMinColumns() nothrowGets the minimum number of columns that the grid will use. Returns: The minimum number of columnsgtk.selection_model.SelectionModel getModel() nothrowGets the model that's currently used to read the items displayed. Returns: The model in usebool getSingleClickActivate() nothrowReturns whether items will be activated on single click and selected on hover. Returns: true if items are activated on single clickgtk.types.ListTabBehavior getTabBehavior() nothrowGets the behavior set for the <kbd>Tab</kbd> key. Returns: The behavior of the <kbd>Tab</kbd> keyvoid scrollTo(uint pos, gtk.types.ListScrollFlags flags, gtk.scroll_info.ScrollInfo scroll = null) nothrowScrolls to the item at the given position and performs the actions specified in flags.void setEnableRubberband(bool enableRubberband) nothrowSets whether selections can be changed by dragging with the mouse.void setFactory(gtk.list_item_factory.ListItemFactory factory = null) nothrowSets the [gtk.list_item_factory.ListItemFactory] to use for populating list items.void setSingleClickActivate(bool singleClickActivate) nothrowSets whether items should be activated on single click and selected on hover.void setTabBehavior(gtk.types.ListTabBehavior tabBehavior) nothrowSets the behavior of the <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> keys.gulong connectActivate(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == uint)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.grid_view.GridView)))
&& Parameters!T.length < 3) nothrowConnect to `Activate` signal.this(gtk.selection_model.SelectionModel model = null, gtk.list_item_factory.ListItemFactory factory = null)Creates a new [gtk.grid_view.GridView] that uses the given factory for mapping items to widgets.Fluent builder implementation template for gtk.grid_view.GridView
T enableRubberband(bool propval) nothrowSet `enableRubberband` property. Params: propval = Allow rubberband selection. Returns: Builder instance for fluent chainingT factory(gtk.list_item_factory.ListItemFactory propval) nothrowSet `factory` property. Params: propval = Factory for populating list items. Returns: Builder instance for fluent chainingT maxColumns(uint propval) nothrowSet `maxColumns` property. Params: propval = Maximum number of columns per row.T minColumns(uint propval) nothrowSet `minColumns` property. Params: propval = Minimum number of columns per row. Returns: Builder instance for fluent chainingT model(gtk.selection_model.SelectionModel propval) nothrowSet `model` property. Params: propval = Model for the items displayed. Returns: Builder instance for fluent chainingT singleClickActivate(bool propval) nothrowSet `singleClickActivate` property. Params: propval = Activate rows on single click and select them on hover. Returns: Builder instance for fluent chainingT tabBehavior(gtk.types.ListTabBehavior propval) nothrowSet `tabBehavior` property. Params: propval = Behavior of the <kbd>Tab</kbd> key Returns: Builder instance for fluent chainingFluent builder for gtk.grid_view.GridView