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 property@Gtk.ColumnView:show-row-separators and property@Gtk.ColumnView:show-column-separators 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 property@Gtk.ColumnView:enable-rubberband.

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 property@Gtk.ColumnView:show-column-separators 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 property@Gtk.ColumnView:show-row-separators 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 _gType() @property
ColumnView self()Returns `this`, for use in `with` statements.
ColumnViewGidBuilder builder()Get builder for [gtk.column_view.ColumnView] Returns: New builder object
gio.list_model.ListModel columns() @propertyGet `columns` property. Returns: The list of columns.
bool enableRubberband() @propertyGet `enableRubberband` property. Returns: Allow rubberband selection.
void enableRubberband(bool propval) @propertySet `enableRubberband` property. Params: propval = Allow rubberband selection.
gtk.list_item_factory.ListItemFactory headerFactory() @propertyGet `headerFactory` property. Returns: Factory for creating header widgets.
void headerFactory(gtk.list_item_factory.ListItemFactory propval) @propertySet `headerFactory` property. Params: propval = Factory for creating header widgets.
gtk.selection_model.SelectionModel model() @propertyGet `model` property. Returns: Model for the items displayed.
void model(gtk.selection_model.SelectionModel propval) @propertySet `model` property. Params: propval = Model for the items displayed.
bool reorderable() @propertyGet `reorderable` property. Returns: Whether columns are reorderable.
void reorderable(bool propval) @propertySet `reorderable` property. Params: propval = Whether columns are reorderable.
gtk.list_item_factory.ListItemFactory rowFactory() @propertyGet `rowFactory` property. Returns: The factory used for configuring rows.
void rowFactory(gtk.list_item_factory.ListItemFactory propval) @propertySet `rowFactory` property. Params: propval = The factory used for configuring rows.
bool showColumnSeparators() @propertyGet `showColumnSeparators` property. Returns: Show separators between columns.
void showColumnSeparators(bool propval) @propertySet `showColumnSeparators` property. Params: propval = Show separators between columns.
bool showRowSeparators() @propertyGet `showRowSeparators` property. Returns: Show separators between rows.
void showRowSeparators(bool propval) @propertySet `showRowSeparators` property. Params: propval = Show separators between rows.
bool singleClickActivate() @propertyGet `singleClickActivate` property. Returns: Activate rows on single click and select them on hover.
void singleClickActivate(bool propval) @propertySet `singleClickActivate` property. Params: propval = Activate rows on single click and select them on hover.
gtk.sorter.Sorter sorter() @propertyGet `sorter` property. Returns: Sorter with the sorting choices of the user.
gtk.types.ListTabBehavior tabBehavior() @propertyGet `tabBehavior` property. Returns: Behavior of the <kbd>Tab</kbd> key
void tabBehavior(gtk.types.ListTabBehavior propval) @propertySet `tabBehavior` property. Params: propval = Behavior of the <kbd>Tab</kbd> key
void appendColumn(gtk.column_view_column.ColumnViewColumn column)Appends the column to the end of the columns in self.
gio.list_model.ListModel getColumns()Gets the list of columns in this column view.
bool getEnableRubberband()Returns whether rows can be selected by dragging with the mouse. Returns: true if rubberband selection is enabled
gtk.list_item_factory.ListItemFactory getHeaderFactory()Gets the factory that's currently used to populate section headers. Returns: The factory in use
gtk.selection_model.SelectionModel getModel()Gets the model that's currently used to read the items displayed. Returns: The model in use
bool getReorderable()Returns whether columns are reorderable. Returns: true if columns are reorderable
gtk.list_item_factory.ListItemFactory getRowFactory()Gets the factory set via [gtk.column_view.ColumnView.setRowFactory]. Returns: The factory
bool getShowColumnSeparators()Returns whether the list should show separators between columns. Returns: true if the list shows column separators
bool getShowRowSeparators()Returns whether the list should show separators between rows. Returns: true if the list shows separators
bool getSingleClickActivate()Returns 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()Returns a special sorter that reflects the users sorting choices in the column view.
gtk.types.ListTabBehavior getTabBehavior()Gets 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)Inserts a column at the given position in the columns of self.
void removeColumn(gtk.column_view_column.ColumnViewColumn column)Removes 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)Scroll 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)Sets whether selections can be changed by dragging with the mouse.
void setHeaderFactory(gtk.list_item_factory.ListItemFactory factory = null)Sets the [gtk.listitemfactory.ListItemFactory] to use for populating the [gtk.list_header.ListHeader] objects used in section headers.
void setModel(gtk.selection_model.SelectionModel model = null)Sets the model to use.
void setReorderable(bool reorderable)Sets whether columns should be reorderable by dragging.
void setRowFactory(gtk.list_item_factory.ListItemFactory factory = null)Sets the factory used for configuring rows. The factory must be for configuring [gtk.columnviewrow.ColumnViewRow] objects.
void setShowColumnSeparators(bool showColumnSeparators)Sets whether the list should show separators between columns.
void setShowRowSeparators(bool showRowSeparators)Sets whether the list should show separators between rows.
void setSingleClickActivate(bool singleClickActivate)Sets whether rows should be activated on single click and selected on hover.
void setTabBehavior(gtk.types.ListTabBehavior tabBehavior)Sets 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)Sets 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)Connect to `Activate` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this(gtk.selection_model.SelectionModel model = null)Creates a new [gtk.column_view.ColumnView].
Methods
T enableRubberband(bool propval)Set `enableRubberband` property. Params: propval = Allow rubberband selection. Returns: Builder instance for fluent chaining
T headerFactory(gtk.list_item_factory.ListItemFactory propval)Set `headerFactory` property. Params: propval = Factory for creating header widgets. Returns: Builder instance for fluent chaining
T model(gtk.selection_model.SelectionModel propval)Set `model` property. Params: propval = Model for the items displayed. Returns: Builder instance for fluent chaining
T reorderable(bool propval)Set `reorderable` property. Params: propval = Whether columns are reorderable. Returns: Builder instance for fluent chaining
T rowFactory(gtk.list_item_factory.ListItemFactory propval)Set `rowFactory` property. Params: propval = The factory used for configuring rows. Returns: Builder instance for fluent chaining
T showColumnSeparators(bool propval)Set `showColumnSeparators` property. Params: propval = Show separators between columns. Returns: Builder instance for fluent chaining
T showRowSeparators(bool propval)Set `showRowSeparators` property. Params: propval = Show separators between rows. Returns: Builder instance for fluent chaining
T singleClickActivate(bool propval)Set `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)Set `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