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

Contents

- Exported types
- Methods
  - new
  - setSortFunc

Description

Sorts items via a callback function.

Synopsis

- newtype CustomSorter = CustomSorter (ManagedPtr CustomSorter)
- class (GObject o, IsDescendantOf CustomSorter o) => IsCustomSorter o
- toCustomSorter :: (MonadIO m, IsCustomSorter o) => o -> m CustomSorter
- customSorterNew :: (HasCallStack, MonadIO m) => Maybe CompareDataFunc -> m CustomSorter
- customSorterSetSortFunc :: (HasCallStack, MonadIO m, IsCustomSorter a) => a -> Maybe CompareDataFunc -> m ()

# Exported types

newtype CustomSorter Source #

Memory-managed wrapper type.

Constructors

CustomSorter (ManagedPtr CustomSorter) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf CustomSorter o) => IsCustomSorter o Source #

Type class for types which can be safely cast to `CustomSorter`, for instance with `toCustomSorter`.

#### Instances

Instances details

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

toCustomSorter :: (MonadIO m, IsCustomSorter o) => o -> m CustomSorter Source #

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

#### Setters

setData, setDataFull, setProperty, setSortFunc.

## new

customSorterNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Maybe CompareDataFunc | `sortFunc`: the `GCompareDataFunc` to use for sorting
-> m CustomSorter | Returns: a new `GtkCustomSorter`

Creates a new `GtkSorter` that works by calling `sortFunc` to compare items.

If `sortFunc` is `Nothing`, all items are considered equal.

## setSortFunc

customSorterSetSortFunc Source #

Arguments

:: (HasCallStack, MonadIO m, IsCustomSorter a) |
=> a | `self`: a `GtkCustomSorter`
-> Maybe CompareDataFunc | `sortFunc`: function to sort items
-> m () |

Sets (or unsets) the function used for sorting items.

If `sortFunc` is `Nothing`, all items are considered equal.

If the sort func changes its sorting behavior, `sorterChanged` needs to be called.

If a previous function was set, its `userDestroy` will be called now.