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.ColumnViewSorter

Description

GtkColumnViewSorter is a sorter implementation that is geared towards the needs of GtkColumnView.

The sorter returned by columnViewGetSorter is a GtkColumnViewSorter.

In column views, sorting can be configured by associating sorters with columns, and users can invert sort order by clicking on column headers. The API of GtkColumnViewSorter is designed to allow saving and restoring this configuration.

If you are only interested in the primary sort column (i.e. the column where a sort indicator is shown in the header), then you can just look at ColumnViewSorter:primarySortColumn and ColumnViewSorter:primarySortOrder.

If you want to store the full sort configuration, including secondary sort columns that are used for tie breaking, then you can use columnViewSorterGetNthSortColumn. To get notified about changes, use Sorter::changed.

To restore a saved sort configuration on a GtkColumnView, use code like:

sorter = gtk_column_view_get_sorter (view);
for (i = gtk_column_view_sorter_get_n_sort_columns (sorter) - 1; i >= 0; i--)
  {
    column = gtk_column_view_sorter_get_nth_sort_column (sorter, i, &order);
    gtk_column_view_sort_by_column (view, column, order);
  }

Since: 4.10

Synopsis

Exported types

newtype ColumnViewSorter Source #

Memory-managed wrapper type.

Constructors

ColumnViewSorter (ManagedPtr ColumnViewSorter) 

Instances

Instances details
Eq ColumnViewSorter Source # 
Instance details

Defined in GI.Gtk.Objects.ColumnViewSorter

GObject ColumnViewSorter Source # 
Instance details

Defined in GI.Gtk.Objects.ColumnViewSorter

ManagedPtrNewtype ColumnViewSorter Source # 
Instance details

Defined in GI.Gtk.Objects.ColumnViewSorter

TypedObject ColumnViewSorter Source # 
Instance details

Defined in GI.Gtk.Objects.ColumnViewSorter

Methods

glibType :: IO GType

HasParentTypes ColumnViewSorter Source # 
Instance details

Defined in GI.Gtk.Objects.ColumnViewSorter

IsGValue (Maybe ColumnViewSorter) Source #

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

Instance details

Defined in GI.Gtk.Objects.ColumnViewSorter

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes ColumnViewSorter Source # 
Instance details

Defined in GI.Gtk.Objects.ColumnViewSorter

type ParentTypes ColumnViewSorter = '[Sorter, Object]

class (GObject o, IsDescendantOf ColumnViewSorter o) => IsColumnViewSorter o Source #

Type class for types which can be safely cast to ColumnViewSorter, for instance with toColumnViewSorter.

Instances

Instances details
(GObject o, IsDescendantOf ColumnViewSorter o) => IsColumnViewSorter o Source # 
Instance details

Defined in GI.Gtk.Objects.ColumnViewSorter

toColumnViewSorter :: (MonadIO m, IsColumnViewSorter o) => o -> m ColumnViewSorter Source #

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

Methods

getNSortColumns

columnViewSorterGetNSortColumns Source #

Arguments

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

self: a GtkColumnViewSorter

-> m Word32

Returns: the number of sort columns

Returns the number of columns by which the sorter sorts.

If the sorter of the primary sort column does not determine a total order, then the secondary sorters are consulted to break the ties.

Use the Sorter::changed signal to get notified when the number of sort columns changes.

Since: 4.10

getNthSortColumn

columnViewSorterGetNthSortColumn Source #

Arguments

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

self: a GtkColumnViewSorter

-> Word32

position: the position of the sort column to retrieve (0 for the primary sort column)

-> m (Maybe ColumnViewColumn, SortType)

Returns: the positions sort column

Gets the position'th sort column and its associated sort order.

Use the Sorter::changed signal to get notified when sort columns change.

Since: 4.10

getPrimarySortColumn

columnViewSorterGetPrimarySortColumn Source #

Arguments

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

self: a GtkColumnViewSorter

-> m (Maybe ColumnViewColumn)

Returns: the primary sort column

Returns the primary sort column.

The primary sort column is the one that displays the triangle in a column view header.

Since: 4.10

getPrimarySortOrder

columnViewSorterGetPrimarySortOrder Source #

Arguments

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

self: a GtkColumnViewSorter

-> m SortType

Returns: the primary sort order

Returns the primary sort order.

The primary sort order determines whether the triangle displayed in the column view header of the primary sort column points upwards or downwards.

If there is no primary sort column, then this function returns GTK_SORT_ASCENDING.

Since: 4.10

Properties

primarySortColumn

The primary sort column.

The primary sort column is the one that displays the triangle in a column view header.

Since: 4.10

getColumnViewSorterPrimarySortColumn :: (MonadIO m, IsColumnViewSorter o) => o -> m (Maybe ColumnViewColumn) Source #

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

get columnViewSorter #primarySortColumn

primarySortOrder

The primary sort order.

The primary sort order determines whether the triangle displayed in the column view header of the primary sort column points upwards or downwards.

Since: 4.10

getColumnViewSorterPrimarySortOrder :: (MonadIO m, IsColumnViewSorter o) => o -> m SortType Source #

Get the value of the “primary-sort-order” property. When overloading is enabled, this is equivalent to

get columnViewSorter #primarySortOrder