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

Contents

- Exported types
- Methods
  - getSorter
  - new
  - setSorter
- Properties
  - sorter

Description

Applies a gives sorter to the levels in a tree.

Here is an example for setting up a column view with a tree model and a `GtkTreeListSorter`:

### c code

    column_sorter = gtk_column_view_get_sorter (view);
    sorter = gtk_tree_list_row_sorter_new (g_object_ref (column_sorter));
    sort_model = gtk_sort_list_model_new (tree_model, sorter);
    selection = gtk_single_selection_new (sort_model);
    gtk_column_view_set_model (view, G_LIST_MODEL (selection));

Synopsis

- newtype TreeListRowSorter = TreeListRowSorter (ManagedPtr TreeListRowSorter)
- class (GObject o, IsDescendantOf TreeListRowSorter o) => IsTreeListRowSorter o
- toTreeListRowSorter :: (MonadIO m, IsTreeListRowSorter o) => o -> m TreeListRowSorter
- treeListRowSorterGetSorter :: (HasCallStack, MonadIO m, IsTreeListRowSorter a) => a -> m (Maybe Sorter)
- treeListRowSorterNew :: (HasCallStack, MonadIO m, IsSorter a) => Maybe a -> m TreeListRowSorter
- treeListRowSorterSetSorter :: (HasCallStack, MonadIO m, IsTreeListRowSorter a, IsSorter b) => a -> Maybe b -> m ()
- clearTreeListRowSorterSorter :: (MonadIO m, IsTreeListRowSorter o) => o -> m ()
- constructTreeListRowSorterSorter :: (IsTreeListRowSorter o, MonadIO m, IsSorter a) => a -> m (GValueConstruct o)
- getTreeListRowSorterSorter :: (MonadIO m, IsTreeListRowSorter o) => o -> m (Maybe Sorter)
- setTreeListRowSorterSorter :: (MonadIO m, IsTreeListRowSorter o, IsSorter a) => o -> a -> m ()

# Exported types

newtype TreeListRowSorter Source #

Memory-managed wrapper type.

Constructors

TreeListRowSorter (ManagedPtr TreeListRowSorter) |

#### Instances

Instances details

Eq TreeListRowSorter Source # |
Instance details Defined in GI.Gtk.Objects.TreeListRowSorter Methods (==) :: TreeListRowSorter -> TreeListRowSorter -> Bool Source # (/=) :: TreeListRowSorter -> TreeListRowSorter -> Bool Source #
GObject TreeListRowSorter Source # |
Instance details Defined in GI.Gtk.Objects.TreeListRowSorter
ManagedPtrNewtype TreeListRowSorter Source # |
Instance details Defined in GI.Gtk.Objects.TreeListRowSorter Methods toManagedPtr :: TreeListRowSorter -> ManagedPtr TreeListRowSorter Source #
TypedObject TreeListRowSorter Source # |
Instance details Defined in GI.Gtk.Objects.TreeListRowSorter Methods glibType :: IO GType Source #
HasParentTypes TreeListRowSorter Source # |
Instance details Defined in GI.Gtk.Objects.TreeListRowSorter
IsGValue (Maybe TreeListRowSorter) Source # | Convert `TreeListRowSorter` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.TreeListRowSorter Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe TreeListRowSorter -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe TreeListRowSorter) Source #
type ParentTypes TreeListRowSorter Source # |
Instance details Defined in GI.Gtk.Objects.TreeListRowSorter type ParentTypes TreeListRowSorter = '[Sorter, Object]

class (GObject o, IsDescendantOf TreeListRowSorter o) => IsTreeListRowSorter o Source #

Type class for types which can be safely cast to `TreeListRowSorter`, for instance with `toTreeListRowSorter`.

#### Instances

Instances details

(GObject o, IsDescendantOf TreeListRowSorter o) => IsTreeListRowSorter o Source # |
Instance details Defined in GI.Gtk.Objects.TreeListRowSorter

toTreeListRowSorter :: (MonadIO m, IsTreeListRowSorter o) => o -> m TreeListRowSorter Source #

Cast to `TreeListRowSorter`, 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, getOrder, getProperty, getQdata, getSorter.

#### Setters

setData, setDataFull, setProperty, setSorter.

## getSorter

treeListRowSorterGetSorter Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeListRowSorter a) |
=> a | `self`: a `GtkTreeListRowSorter`
-> m (Maybe Sorter) | Returns: the sorter used

Returns the sorter used by `self`.

## new

treeListRowSorterNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsSorter a) |
=> Maybe a | `sorter`: a `GtkSorter`
-> m TreeListRowSorter | Returns: a new `GtkTreeListRowSorter`

Create a special-purpose sorter that applies the sorting of `sorter` to the levels of a `GtkTreeListModel`.

Note that this sorter relies on TreeListModel:passthrough being `False` as it can only sort `TreeListRow`s.

## setSorter

treeListRowSorterSetSorter Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeListRowSorter a, IsSorter b) |
=> a | `self`: a `GtkTreeListRowSorter`
-> Maybe b | `sorter`: The sorter to use
-> m () |

Sets the sorter to use for items with the same parent.

This sorter will be passed the TreeListRow:item of the tree list rows passed to `self`.

# Properties

## sorter

The underlying sorter

clearTreeListRowSorterSorter :: (MonadIO m, IsTreeListRowSorter o) => o -> m () Source #

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

    clear #sorter

constructTreeListRowSorterSorter :: (IsTreeListRowSorter o, MonadIO m, IsSorter a) => a -> m (GValueConstruct o) Source #

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

getTreeListRowSorterSorter :: (MonadIO m, IsTreeListRowSorter o) => o -> m (Maybe Sorter) Source #

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

    get treeListRowSorter #sorter

setTreeListRowSorterSorter :: (MonadIO m, IsTreeListRowSorter o, IsSorter a) => o -> a -> m () Source #

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

    set treeListRowSorter [ #sorter := value ]