Package: gtk

Class gtk:column-view

Superclasses

Documented Subclasses

None

Direct Slots

columns
The columns property of type g:list-model (Read)
The list of columns.
enable-rubberband
The enable-rubberband property of type :boolean (Read / Write)
Allow rubberband selection.
Default value: false
header-factory
The header-factory property of type gtk:list-item-factory (Read / Write)
Factory for creating header widgets. Since 4.12
model
The model property of type gtk:selection-model (Read / Write)
Model for the items displayed.
reorderable
The reorderable property of type :boolean (Read / Write)
Whether columns are reorderable.
Default value: true
row-factory
The row-factory property of type gtk:list-item-factory (Read / Write)
The factory used for configuring rows. Since 4.12
show-column-separators
The show-column-separators property of type :boolean (Read / Write)
Show separators between columns.
Default value: false
show-row-separators
The show-row-separators property of type :boolean (Read / Write)
Show separators between rows.
Default value: false
single-click-activate
The single-click-activate property of type :boolean (Read / Write)
Activate rows on single click and select them on hover.
Default value: false
sorter
The sorter property of type gtk:sorter (Read)
Sorter with the sorting choices of the user.
tab-behavior
The tab-behavior property of type gtk:list-tab-behavior (Read / Write)
Behavior of the Tab key.
Default value: :all

Details

The gtk:column-view widget is a widget to present a view into a large dynamic list of items using multiple columns with headers. The gtk:column-view widget 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 show-row-separators and show-column-separators properties offer a simple way to display separators between the rows or columns.

The gtk:column-view widget 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 the enable-rubberband property.

The column view supports sorting that can be customized by the user by clicking on column headers. To set this up, the gtk:sorter object returned by the gtk:column-view-sorter function 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 (setf gtk:column-view-column-sorter) function. The initial sort order can be set with the gtk:column-view-sort-by-column function.

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 reorderable and resizable properties.

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

CSS nodes

The gtk:column-view implementation uses a single CSS node named columnview. It may carry the .column-separators style class, when show-column-separators property is set. Header widgets appear below a node with name header. The rows are contained in a gtk:list-view widget, so there is a listview node with the same structure as for a standalone gtk:list-view widget. If the show-row-separators property 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

The gtk:column-view implementation uses the :tree-grid role of the gtk:accessible-role enumeration, header title widgets are using the :column-header role. The row widgets are using the :row role, and individual cells are using the :grid-cell role.

Signal Details

The "activate" signal
lambda (columnview position)    :run-last      
columnview
The gtk:column-view widget.
position
An unsigned integer with the position of the item to activate.
The signal is emitted when a row has been activated by the user. This allows for a convenient way to handle activation in a columnview. See the gtk:list-item-activatable function for details on how to use this signal.
 

Returned by

Slot Access Functions

Inherited Slot Access Functions

See also

2024-11-28