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

Contents

- Exported types
- Methods
  - append
  - new
  - remove
- Properties
  - itemType
  - nItems

Description

Combines multiple sorters by trying them in turn.

If the first sorter compares two items as equal, the second is tried next, and so on.

Synopsis

- newtype MultiSorter = MultiSorter (ManagedPtr MultiSorter)
- class (GObject o, IsDescendantOf MultiSorter o) => IsMultiSorter o
- toMultiSorter :: (MonadIO m, IsMultiSorter o) => o -> m MultiSorter
- multiSorterAppend :: (HasCallStack, MonadIO m, IsMultiSorter a, IsSorter b) => a -> b -> m ()
- multiSorterNew :: (HasCallStack, MonadIO m) => m MultiSorter
- multiSorterRemove :: (HasCallStack, MonadIO m, IsMultiSorter a) => a -> Word32 -> m ()
- getMultiSorterItemType :: (MonadIO m, IsMultiSorter o) => o -> m GType
- getMultiSorterNItems :: (MonadIO m, IsMultiSorter o) => o -> m Word32

# Exported types

newtype MultiSorter Source #

Memory-managed wrapper type.

Constructors

MultiSorter (ManagedPtr MultiSorter) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf MultiSorter o) => IsMultiSorter o Source #

Type class for types which can be safely cast to `MultiSorter`, for instance with `toMultiSorter`.

#### Instances

Instances details

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

toMultiSorter :: (MonadIO m, IsMultiSorter o) => o -> m MultiSorter Source #

Cast to `MultiSorter`, 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

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

#### Getters

getBuildableId, getData, getItem, getItemType, getNItems, getOrder, getProperty, getQdata.

#### Setters

setData, setDataFull, setProperty.

## append

multiSorterAppend Source #

Arguments

:: (HasCallStack, MonadIO m, IsMultiSorter a, IsSorter b) |
=> a | `self`: a `GtkMultiSorter`
-> b | `sorter`: a sorter to add
-> m () |

Add `sorter` to `self` to use for sorting at the end.

`self` will consult all existing sorters before it will sort with the given `sorter`.

## new

multiSorterNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m MultiSorter | Returns: a new `GtkMultiSorter`

Creates a new multi sorter.

This sorter compares items by trying each of the sorters in turn, until one returns non-zero. In particular, if no sorter has been added to it, it will always compare items as equal.

## remove

multiSorterRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsMultiSorter a) |
=> a | `self`: a `GtkMultiSorter`
-> Word32 | `position`: position of sorter to remove
-> m () |

Removes the sorter at the given `position` from the list of sorter used by `self`.

If `position` is larger than the number of sorters, nothing happens.

# Properties

## itemType

The type of items. See `listModelGetItemType`.

Since: 4.8

getMultiSorterItemType :: (MonadIO m, IsMultiSorter o) => o -> m GType Source #

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

    get multiSorter #itemType

## nItems

The number of items. See `listModelGetNItems`.

Since: 4.8

getMultiSorterNItems :: (MonadIO m, IsMultiSorter o) => o -> m Word32 Source #

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

    get multiSorter #nItems