gtk.column_view

Module for [ColumnView] class

Types 3

gtk.column_view.ColumnView presents a large dynamic list of items using multiple columns with headers.

gtk.column_view.ColumnView uses the factories of its columns to generate a cell widget for each column, for each visible item and displays them together as the row for this item.

The gtk.column_view.ColumnView.showRowSeparators and gtk.column_view.ColumnView.showColumnSeparators properties offer a simple way to display separators between the rows or columns.

gtk.column_view.ColumnView 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.column_view.ColumnView.enableRubberband.

The column view supports sorting that can be customized by the user by clicking on column headers. To set this up, the gtk.sorter.Sorter returned by gtk.column_view.ColumnView.getSorter must be attached to a sort model for the data that the view is showing, and the columns must have sorters attached to them by calling gtk.column_view_column.ColumnViewColumn.setSorter. The initial sort order can be set with gtk.column_view.ColumnView.sortByColumn.

The column view also supports interactive resizing and reordering of columns, via Drag-and-Drop of the column headers. This can be enabled or disabled with the gtk.column_view.ColumnView.reorderable and gtk.column_view_column.ColumnViewColumn.resizable properties.

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

CSS nodes

columnview[.column-separators][.rich-list][.navigation-sidebar][.data-table]
├── header
│   ├── <column header>
┊   ┊
│   ╰── <column header>
│
├── listview
│
┊
╰── [rubberband]

gtk.column_view.ColumnView uses a single CSS node named columnview. It may carry the .column-separators style class, when gtk.column_view.ColumnView.showColumnSeparators property is set. Header widgets appear below a node with name header. The rows are contained in a gtk.list_view.ListView widget, so there is a listview node with the same structure as for a standalone gtk.list_view.ListView widget. If gtk.column_view.ColumnView.showRowSeparators is set, it will be passed on to the list view, causing its CSS node to carry the .separators style class. For rubberband selection, a node with name rubberband is used.

The main columnview node may also carry style classes to select the style of list presentation: .rich-list, .navigation-sidebar or .data-table.

Accessibility

gtk.column_view.ColumnView uses the gtk.types.AccessibleRole.TreeGrid role, header title widgets are using the gtk.types.AccessibleRole.ColumnHeader role. The row widgets are using the gtk.types.AccessibleRole.Row role, and individual cells are using the gtk.types.AccessibleRole.GridCell role

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
ColumnView self() nothrowReturns `this`, for use in `with` statements.
ColumnViewGidBuilder builder() static nothrowGet builder for [gtk.column_view.ColumnView] Returns: New builder object
gio.list_model.ListModel columns() @property nothrowGet `columns` property. Returns: The list of columns.
bool 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 headerFactory() @property nothrowGet `headerFactory` property. Returns: Factory for creating header widgets.
void headerFactory(gtk.list_item_factory.ListItemFactory propval) @property nothrowSet `headerFactory` property. Params: propval = Factory for creating header widgets.
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 reorderable() @property nothrowGet `reorderable` property. Returns: Whether columns are reorderable.
void reorderable(bool propval) @property nothrowSet `reorderable` property. Params: propval = Whether columns are reorderable.
gtk.list_item_factory.ListItemFactory rowFactory() @property nothrowGet `rowFactory` property. Returns: The factory used for configuring rows.
void rowFactory(gtk.list_item_factory.ListItemFactory propval) @property nothrowSet `rowFactory` property. Params: propval = The factory used for configuring rows.
bool showColumnSeparators() @property nothrowGet `showColumnSeparators` property. Returns: Show separators between columns.
void showColumnSeparators(bool propval) @property nothrowSet `showColumnSeparators` property. Params: propval = Show separators between columns.
bool showRowSeparators() @property nothrowGet `showRowSeparators` property. Returns: Show separators between rows.
void showRowSeparators(bool propval) @property nothrowSet `showRowSeparators` property. Params: propval = Show separators between rows.
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.sorter.Sorter sorter() @property nothrowGet `sorter` property. Returns: Sorter with the sorting choices of the user.
gtk.types.ListTabBehavior tabBehavior() @property nothrowGet `tabBehavior` property. Returns: Behavior of the <kbd>Tab</kbd> key
void tabBehavior(gtk.types.ListTabBehavior propval) @property nothrowSet `tabBehavior` property. Params: propval = Behavior of the <kbd>Tab</kbd> key
void appendColumn(gtk.column_view_column.ColumnViewColumn column) nothrowAppends the column to the end of the columns in self.
gio.list_model.ListModel getColumns() nothrowGets the list of columns in this column view.
bool getEnableRubberband() nothrowReturns whether rows can be selected by dragging with the mouse. Returns: true if rubberband selection is enabled
gtk.list_item_factory.ListItemFactory getHeaderFactory() nothrowGets the factory that's currently used to populate section headers. Returns: The factory in use
gtk.selection_model.SelectionModel getModel() nothrowGets the model that's currently used to read the items displayed. Returns: The model in use
bool getReorderable() nothrowReturns whether columns are reorderable. Returns: true if columns are reorderable
gtk.list_item_factory.ListItemFactory getRowFactory() nothrowGets the factory set via [gtk.column_view.ColumnView.setRowFactory]. Returns: The factory
bool getShowColumnSeparators() nothrowReturns whether the list should show separators between columns. Returns: true if the list shows column separators
bool getShowRowSeparators() nothrowReturns whether the list should show separators between rows. Returns: true if the list shows separators
bool getSingleClickActivate() nothrowReturns whether rows will be activated on single click and selected on hover. Returns: true if rows are activated on single click
gtk.sorter.Sorter getSorter() nothrowReturns a special sorter that reflects the users sorting choices in the column view.
gtk.types.ListTabBehavior getTabBehavior() nothrowGets the behavior set for the <kbd>Tab</kbd> key. Returns: The behavior of the <kbd>Tab</kbd> key
void insertColumn(uint position, gtk.column_view_column.ColumnViewColumn column) nothrowInserts a column at the given position in the columns of self.
void removeColumn(gtk.column_view_column.ColumnViewColumn column) nothrowRemoves the column from the list of columns of self.
void scrollTo(uint pos, gtk.column_view_column.ColumnViewColumn column, gtk.types.ListScrollFlags flags, gtk.scroll_info.ScrollInfo scroll = null) nothrowScroll to the row at the given position - or cell if a column is given - and performs the actions specified in flags.
void setEnableRubberband(bool enableRubberband) nothrowSets whether selections can be changed by dragging with the mouse.
void setHeaderFactory(gtk.list_item_factory.ListItemFactory factory = null) nothrowSets the [gtk.list_item_factory.ListItemFactory] to use for populating the [gtk.list_header.ListHeader] objects used in section headers.
void setModel(gtk.selection_model.SelectionModel model = null) nothrowSets the model to use.
void setReorderable(bool reorderable) nothrowSets whether columns should be reorderable by dragging.
void setRowFactory(gtk.list_item_factory.ListItemFactory factory = null) nothrowSets the factory used for configuring rows. The factory must be for configuring [gtk.column_view_row.ColumnViewRow] objects.
void setShowColumnSeparators(bool showColumnSeparators) nothrowSets whether the list should show separators between columns.
void setShowRowSeparators(bool showRowSeparators) nothrowSets whether the list should show separators between rows.
void setSingleClickActivate(bool singleClickActivate) nothrowSets whether rows 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.
void sortByColumn(gtk.column_view_column.ColumnViewColumn column, gtk.types.SortType direction) nothrowSets the sorting of the view.
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.column_view.ColumnView))) && Parameters!T.length < 3) nothrowConnect to `Activate` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this(gtk.selection_model.SelectionModel model = null)Creates a new [gtk.column_view.ColumnView].

Fluent builder implementation template for gtk.column_view.ColumnView

Methods
T enableRubberband(bool propval) nothrowSet `enableRubberband` property. Params: propval = Allow rubberband selection. Returns: Builder instance for fluent chaining
T headerFactory(gtk.list_item_factory.ListItemFactory propval) nothrowSet `headerFactory` property. Params: propval = Factory for creating header widgets. Returns: Builder instance for fluent chaining
T model(gtk.selection_model.SelectionModel propval) nothrowSet `model` property. Params: propval = Model for the items displayed. Returns: Builder instance for fluent chaining
T reorderable(bool propval) nothrowSet `reorderable` property. Params: propval = Whether columns are reorderable. Returns: Builder instance for fluent chaining
T rowFactory(gtk.list_item_factory.ListItemFactory propval) nothrowSet `rowFactory` property. Params: propval = The factory used for configuring rows. Returns: Builder instance for fluent chaining
T showColumnSeparators(bool propval) nothrowSet `showColumnSeparators` property. Params: propval = Show separators between columns. Returns: Builder instance for fluent chaining
T showRowSeparators(bool propval) nothrowSet `showRowSeparators` property. Params: propval = Show separators between rows. Returns: Builder instance for fluent chaining
T singleClickActivate(bool propval) nothrowSet `singleClickActivate` property. Params: propval = Activate rows on single click and select them on hover. Returns: Builder instance for fluent chaining
T tabBehavior(gtk.types.ListTabBehavior propval) nothrowSet `tabBehavior` property. Params: propval = Behavior of the <kbd>Tab</kbd> key Returns: Builder instance for fluent chaining

Fluent builder for gtk.column_view.ColumnView

Methods
ColumnView build() nothrowCreate object from builder. Returns: New object