gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.ColumnViewSorter

Contents

- Exported types
- Methods
  - getNSortColumns
  - getNthSortColumn
  - getPrimarySortColumn
  - getPrimarySortOrder
- Properties
  - primarySortColumn
  - primarySortOrder

Description

Sorts `ColumnView` columns.

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

- newtype ColumnViewSorter = ColumnViewSorter (ManagedPtr ColumnViewSorter)
- class (GObject o, IsDescendantOf ColumnViewSorter o) => IsColumnViewSorter o
- toColumnViewSorter :: (MonadIO m, IsColumnViewSorter o) => o -> m ColumnViewSorter
- columnViewSorterGetNSortColumns :: (HasCallStack, MonadIO m, IsColumnViewSorter a) => a -> m Word32
- columnViewSorterGetNthSortColumn :: (HasCallStack, MonadIO m, IsColumnViewSorter a) => a -> Word32 -> m (Maybe ColumnViewColumn, SortType)
- columnViewSorterGetPrimarySortColumn :: (HasCallStack, MonadIO m, IsColumnViewSorter a) => a -> m (Maybe ColumnViewColumn)
- columnViewSorterGetPrimarySortOrder :: (HasCallStack, MonadIO m, IsColumnViewSorter a) => a -> m SortType
- getColumnViewSorterPrimarySortColumn :: (MonadIO m, IsColumnViewSorter o) => o -> m (Maybe ColumnViewColumn)
- getColumnViewSorterPrimarySortOrder :: (MonadIO m, IsColumnViewSorter o) => o -> m SortType

# 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 Methods (==) :: ColumnViewSorter -> ColumnViewSorter -> Bool Source # (/=) :: ColumnViewSorter -> ColumnViewSorter -> Bool Source #
GObject ColumnViewSorter Source # |
Instance details Defined in GI.Gtk.Objects.ColumnViewSorter
ManagedPtrNewtype ColumnViewSorter Source # |
Instance details Defined in GI.Gtk.Objects.ColumnViewSorter Methods toManagedPtr :: ColumnViewSorter -> ManagedPtr ColumnViewSorter Source #
TypedObject ColumnViewSorter Source # |
Instance details Defined in GI.Gtk.Objects.ColumnViewSorter Methods glibType :: IO GType Source #
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 Source # gvalueSet_ :: Ptr GValue -> Maybe ColumnViewSorter -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe ColumnViewSorter) Source #
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

### Click to display all available methods, including inherited ones

Expand

#### Methods

bindProperty, bindPropertyFull, changed, compare, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getData, getNSortColumns, getNthSortColumn, getOrder, getPrimarySortColumn, getPrimarySortOrder, getProperty, getQdata.

#### Setters

setData, setDataFull, setProperty.

## getNSortColumns

columnViewSorterGetNSortColumns Source #

Arguments

:: (HasCallStack, MonadIO m, IsColumnViewSorter a) |
=> a | `self`: a columnviewsorter
-> 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 columnviewsorter
-> Word32 | `position`: the position of the sort column to retrieve (0 for the primary sort column)
-> m (Maybe ColumnViewColumn, SortType) | Returns: the sort column at the `position`

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 columnviewsorter
-> 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 columnviewsorter
-> 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