gi-gtk-4.0.8: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.ColumnView

Description

GtkColumnView presents a large dynamic list of items using multiple columns with headers.

GtkColumnView 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 ColumnView:showRowSeparators and ColumnView:showColumnSeparators properties offer a simple way to display separators between the rows or columns.

GtkColumnView 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 ColumnView:enableRubberband.

The column view supports sorting that can be customized by the user by clicking on column headers. To set this up, the GtkSorter returned by columnViewGetSorter 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 columnViewColumnSetSorter. The initial sort order can be set with columnViewSortByColumn.

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 ColumnView:reorderable and 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]

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

GtkColumnView uses the AccessibleRoleTreeGrid role, header title widgets are using the AccessibleRoleColumnHeader role. The row widgets are using the AccessibleRoleRow role, and individual cells are using the AccessibleRoleGridCell role

Synopsis

Exported types

newtype ColumnView Source #

Memory-managed wrapper type.

Constructors

ColumnView (ManagedPtr ColumnView) 

Instances

Instances details
Eq ColumnView Source # 
Instance details

Defined in GI.Gtk.Objects.ColumnView

GObject ColumnView Source # 
Instance details

Defined in GI.Gtk.Objects.ColumnView

ManagedPtrNewtype ColumnView Source # 
Instance details

Defined in GI.Gtk.Objects.ColumnView

Methods

toManagedPtr :: ColumnView -> ManagedPtr ColumnView

TypedObject ColumnView Source # 
Instance details

Defined in GI.Gtk.Objects.ColumnView

Methods

glibType :: IO GType

HasParentTypes ColumnView Source # 
Instance details

Defined in GI.Gtk.Objects.ColumnView

IsGValue (Maybe ColumnView) Source #

Convert ColumnView to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.ColumnView

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe ColumnView -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe ColumnView)

type ParentTypes ColumnView Source # 
Instance details

Defined in GI.Gtk.Objects.ColumnView

class (GObject o, IsDescendantOf ColumnView o) => IsColumnView o Source #

Type class for types which can be safely cast to ColumnView, for instance with toColumnView.

Instances

Instances details
(GObject o, IsDescendantOf ColumnView o) => IsColumnView o Source # 
Instance details

Defined in GI.Gtk.Objects.ColumnView

toColumnView :: (MonadIO m, IsColumnView o) => o -> m ColumnView Source #

Cast to ColumnView, for types for which this is known to be safe. For general casts, use castTo.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, appendColumn, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, insertColumn, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeColumn, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, sortByColumn, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBorder, getBounds, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getColumns, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getEnableRubberband, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHadjustment, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getHscrollPolicy, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getModel, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getReorderable, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getShowColumnSeparators, getShowRowSeparators, getSingleClickActivate, getSize, getSizeRequest, getSorter, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getVadjustment, getValign, getVexpand, getVexpandSet, getVisible, getVscrollPolicy, getWidth.

Setters

setAccessibleParent, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setEnableRubberband, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHadjustment, setHalign, setHasTooltip, setHexpand, setHexpandSet, setHscrollPolicy, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setModel, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setReorderable, setSensitive, setShowColumnSeparators, setShowRowSeparators, setSingleClickActivate, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setVadjustment, setValign, setVexpand, setVexpandSet, setVisible, setVscrollPolicy.

appendColumn

columnViewAppendColumn Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a, IsColumnViewColumn b) 
=> a

self: a GtkColumnView

-> b

column: a GtkColumnViewColumn that hasn't been added to a GtkColumnView yet

-> m () 

Appends the column to the end of the columns in self.

getColumns

columnViewGetColumns Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a) 
=> a

self: a GtkColumnView

-> m ListModel

Returns: The list managing the columns

Gets the list of columns in this column view.

This list is constant over the lifetime of self and can be used to monitor changes to the columns of self by connecting to the itemsChanged signal.

getEnableRubberband

columnViewGetEnableRubberband Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a) 
=> a

self: a GtkColumnView

-> m Bool

Returns: True if rubberband selection is enabled

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

getModel

columnViewGetModel Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a) 
=> a

self: a GtkColumnView

-> m (Maybe SelectionModel)

Returns: The model in use

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

getReorderable

columnViewGetReorderable Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a) 
=> a

self: a GtkColumnView

-> m Bool

Returns: True if columns are reorderable

Returns whether columns are reorderable.

getShowColumnSeparators

columnViewGetShowColumnSeparators Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a) 
=> a

self: a GtkColumnView

-> m Bool

Returns: True if the list shows column separators

Returns whether the list should show separators between columns.

getShowRowSeparators

columnViewGetShowRowSeparators Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a) 
=> a

self: a GtkColumnView

-> m Bool

Returns: True if the list shows separators

Returns whether the list should show separators between rows.

getSingleClickActivate

columnViewGetSingleClickActivate Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a) 
=> a

self: a GtkColumnView

-> m Bool

Returns: True if rows are activated on single click

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

getSorter

columnViewGetSorter Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a) 
=> a

self: a GtkColumnView

-> m (Maybe Sorter)

Returns: the GtkSorter of self

Returns a special sorter that reflects the users sorting choices in the column view.

To allow users to customizable sorting by clicking on column headers, this sorter needs to be set on the sort model underneath the model that is displayed by the view.

See columnViewColumnSetSorter for setting up per-column sorting.

Here is an example:

c code

gtk_column_view_column_set_sorter (column, sorter);
gtk_column_view_append_column (view, column);
sorter = g_object_ref (gtk_column_view_get_sorter (view)));
model = gtk_sort_list_model_new (store, sorter);
selection = gtk_no_selection_new (model);
gtk_column_view_set_model (view, selection);

insertColumn

columnViewInsertColumn Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a, IsColumnViewColumn b) 
=> a

self: a GtkColumnView

-> Word32

position: the position to insert column at

-> b

column: the GtkColumnViewColumn to insert

-> m () 

Inserts a column at the given position in the columns of self.

If column is already a column of self, it will be repositioned.

new

columnViewNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsSelectionModel a) 
=> Maybe a

model: the list model to use

-> m ColumnView

Returns: a new GtkColumnView

Creates a new GtkColumnView.

You most likely want to call columnViewAppendColumn to add columns next.

removeColumn

columnViewRemoveColumn Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a, IsColumnViewColumn b) 
=> a

self: a GtkColumnView

-> b

column: a GtkColumnViewColumn that's part of self

-> m () 

Removes the column from the list of columns of self.

setEnableRubberband

columnViewSetEnableRubberband Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a) 
=> a

self: a GtkColumnView

-> Bool

enableRubberband: True to enable rubberband selection

-> m () 

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

setModel

columnViewSetModel Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a, IsSelectionModel b) 
=> a

self: a GtkColumnView

-> Maybe b

model: the model to use

-> m () 

Sets the model to use.

This must be a SelectionModel.

setReorderable

columnViewSetReorderable Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a) 
=> a

self: a GtkColumnView

-> Bool

reorderable: whether columns should be reorderable

-> m () 

Sets whether columns should be reorderable by dragging.

setShowColumnSeparators

columnViewSetShowColumnSeparators Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a) 
=> a

self: a GtkColumnView

-> Bool

showColumnSeparators: True to show column separators

-> m () 

Sets whether the list should show separators between columns.

setShowRowSeparators

columnViewSetShowRowSeparators Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a) 
=> a

self: a GtkColumnView

-> Bool

showRowSeparators: True to show row separators

-> m () 

Sets whether the list should show separators between rows.

setSingleClickActivate

columnViewSetSingleClickActivate Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a) 
=> a

self: a GtkColumnView

-> Bool

singleClickActivate: True to activate items on single click

-> m () 

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

sortByColumn

columnViewSortByColumn Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnView a, IsColumnViewColumn b) 
=> a

self: a GtkColumnView

-> Maybe b

column: the GtkColumnViewColumn to sort by

-> SortType

direction: the direction to sort in

-> m () 

Sets the sorting of the view.

This function should be used to set up the initial sorting. At runtime, users can change the sorting of a column view by clicking on the list headers.

This call only has an effect if the sorter returned by columnViewGetSorter is set on a sort model, and columnViewColumnSetSorter has been called on column to associate a sorter with the column.

If column is Nothing, the view will be unsorted.

Properties

columns

The list of columns.

getColumnViewColumns :: (MonadIO m, IsColumnView o) => o -> m ListModel Source #

Get the value of the “columns” property. When overloading is enabled, this is equivalent to

get columnView #columns

enableRubberband

Allow rubberband selection.

constructColumnViewEnableRubberband :: (IsColumnView o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “enable-rubberband” property. This is rarely needed directly, but it is used by new.

getColumnViewEnableRubberband :: (MonadIO m, IsColumnView o) => o -> m Bool Source #

Get the value of the “enable-rubberband” property. When overloading is enabled, this is equivalent to

get columnView #enableRubberband

setColumnViewEnableRubberband :: (MonadIO m, IsColumnView o) => o -> Bool -> m () Source #

Set the value of the “enable-rubberband” property. When overloading is enabled, this is equivalent to

set columnView [ #enableRubberband := value ]

model

Model for the items displayed.

clearColumnViewModel :: (MonadIO m, IsColumnView o) => o -> m () Source #

Set the value of the “model” property to Nothing. When overloading is enabled, this is equivalent to

clear #model

constructColumnViewModel :: (IsColumnView o, MonadIO m, IsSelectionModel a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “model” property. This is rarely needed directly, but it is used by new.

getColumnViewModel :: (MonadIO m, IsColumnView o) => o -> m (Maybe SelectionModel) Source #

Get the value of the “model” property. When overloading is enabled, this is equivalent to

get columnView #model

setColumnViewModel :: (MonadIO m, IsColumnView o, IsSelectionModel a) => o -> a -> m () Source #

Set the value of the “model” property. When overloading is enabled, this is equivalent to

set columnView [ #model := value ]

reorderable

Whether columns are reorderable.

constructColumnViewReorderable :: (IsColumnView o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “reorderable” property. This is rarely needed directly, but it is used by new.

getColumnViewReorderable :: (MonadIO m, IsColumnView o) => o -> m Bool Source #

Get the value of the “reorderable” property. When overloading is enabled, this is equivalent to

get columnView #reorderable

setColumnViewReorderable :: (MonadIO m, IsColumnView o) => o -> Bool -> m () Source #

Set the value of the “reorderable” property. When overloading is enabled, this is equivalent to

set columnView [ #reorderable := value ]

showColumnSeparators

Show separators between columns.

constructColumnViewShowColumnSeparators :: (IsColumnView o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “show-column-separators” property. This is rarely needed directly, but it is used by new.

getColumnViewShowColumnSeparators :: (MonadIO m, IsColumnView o) => o -> m Bool Source #

Get the value of the “show-column-separators” property. When overloading is enabled, this is equivalent to

get columnView #showColumnSeparators

setColumnViewShowColumnSeparators :: (MonadIO m, IsColumnView o) => o -> Bool -> m () Source #

Set the value of the “show-column-separators” property. When overloading is enabled, this is equivalent to

set columnView [ #showColumnSeparators := value ]

showRowSeparators

Show separators between rows.

constructColumnViewShowRowSeparators :: (IsColumnView o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “show-row-separators” property. This is rarely needed directly, but it is used by new.

getColumnViewShowRowSeparators :: (MonadIO m, IsColumnView o) => o -> m Bool Source #

Get the value of the “show-row-separators” property. When overloading is enabled, this is equivalent to

get columnView #showRowSeparators

setColumnViewShowRowSeparators :: (MonadIO m, IsColumnView o) => o -> Bool -> m () Source #

Set the value of the “show-row-separators” property. When overloading is enabled, this is equivalent to

set columnView [ #showRowSeparators := value ]

singleClickActivate

Activate rows on single click and select them on hover.

constructColumnViewSingleClickActivate :: (IsColumnView o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “single-click-activate” property. This is rarely needed directly, but it is used by new.

getColumnViewSingleClickActivate :: (MonadIO m, IsColumnView o) => o -> m Bool Source #

Get the value of the “single-click-activate” property. When overloading is enabled, this is equivalent to

get columnView #singleClickActivate

setColumnViewSingleClickActivate :: (MonadIO m, IsColumnView o) => o -> Bool -> m () Source #

Set the value of the “single-click-activate” property. When overloading is enabled, this is equivalent to

set columnView [ #singleClickActivate := value ]

sorter

Sorter with the sorting choices of the user.

getColumnViewSorter :: (MonadIO m, IsColumnView o) => o -> m (Maybe Sorter) Source #

Get the value of the “sorter” property. When overloading is enabled, this is equivalent to

get columnView #sorter

Signals

activate

type ColumnViewActivateCallback Source #

Arguments

 = Word32

position: position of item to activate

-> IO () 

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

This allows for a convenient way to handle activation in a columnview. See listItemSetActivatable for details on how to use this signal.

afterColumnViewActivate :: (IsColumnView a, MonadIO m) => a -> ((?self :: a) => ColumnViewActivateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the activate signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after columnView #activate callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onColumnViewActivate :: (IsColumnView a, MonadIO m) => a -> ((?self :: a) => ColumnViewActivateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the activate signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on columnView #activate callback