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.Interfaces.TreeSortable

Contents

- Exported types
- Methods
  - getSortColumnId
  - hasDefaultSortFunc
  - setDefaultSortFunc
  - setSortColumnId
  - setSortFunc
  - sortColumnChanged
- Signals
  - sortColumnChanged

Description

The interface for sortable models used by GtkTreeView

`GtkTreeSortable` is an interface to be implemented by tree models which support sorting. The `GtkTreeView` uses the methods provided by this interface to sort the model.

Synopsis

- newtype TreeSortable = TreeSortable (ManagedPtr TreeSortable)
- class (GObject o, IsDescendantOf TreeSortable o) => IsTreeSortable o
- toTreeSortable :: (MonadIO m, IsTreeSortable o) => o -> m TreeSortable
- treeSortableGetSortColumnId :: (HasCallStack, MonadIO m, IsTreeSortable a) => a -> m (Bool, Int32, SortType)
- treeSortableHasDefaultSortFunc :: (HasCallStack, MonadIO m, IsTreeSortable a) => a -> m Bool
- treeSortableSetDefaultSortFunc :: (HasCallStack, MonadIO m, IsTreeSortable a) => a -> TreeIterCompareFunc -> m ()
- treeSortableSetSortColumnId :: (HasCallStack, MonadIO m, IsTreeSortable a) => a -> Int32 -> SortType -> m ()
- treeSortableSetSortFunc :: (HasCallStack, MonadIO m, IsTreeSortable a) => a -> Int32 -> TreeIterCompareFunc -> m ()
- treeSortableSortColumnChanged :: (HasCallStack, MonadIO m, IsTreeSortable a) => a -> m ()
- type TreeSortableSortColumnChangedCallback = IO ()
- afterTreeSortableSortColumnChanged :: (IsTreeSortable a, MonadIO m) => a -> ((?self :: a) => TreeSortableSortColumnChangedCallback) -> m SignalHandlerId
- onTreeSortableSortColumnChanged :: (IsTreeSortable a, MonadIO m) => a -> ((?self :: a) => TreeSortableSortColumnChangedCallback) -> m SignalHandlerId

# Exported types

newtype TreeSortable Source #

Deprecated: (Since version 4.10)There is no replacement for this interface. You shoulduse `SortListModel` to wrap your list model instead

Memory-managed wrapper type.

Constructors

TreeSortable (ManagedPtr TreeSortable) | Deprecated: (Since version 4.10)There is no replacement for this interface. You shoulduse `SortListModel` to wrap your list model instead

#### Instances

Instances details

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

class (GObject o, IsDescendantOf TreeSortable o) => IsTreeSortable o Source #

Type class for types which can be safely cast to `TreeSortable`, for instance with `toTreeSortable`.

#### Instances

Instances details

(GObject o, IsDescendantOf TreeSortable o) => IsTreeSortable o Source # |
Instance details Defined in GI.Gtk.Interfaces.TreeSortable

toTreeSortable :: (MonadIO m, IsTreeSortable o) => o -> m TreeSortable Source #

Cast to `TreeSortable`, 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, filterNew, forceFloating, foreach, freezeNotify, getv, hasDefaultSortFunc, isFloating, iterChildren, iterHasChild, iterNChildren, iterNext, iterNthChild, iterParent, iterPrevious, notify, notifyByPspec, ref, refNode, refSink, rowChanged, rowDeleted, rowHasChildToggled, rowInserted, rowsReordered, runDispose, sortColumnChanged, stealData, stealQdata, thawNotify, unref, unrefNode, watchClosure.

#### Getters

getColumnType, getData, getFlags, getIter, getIterFirst, getIterFromString, getNColumns, getPath, getProperty, getQdata, getSortColumnId, getStringFromIter, getValue.

#### Setters

setData, setDataFull, setDefaultSortFunc, setProperty, setSortColumnId, setSortFunc.

## getSortColumnId

treeSortableGetSortColumnId Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeSortable a) |
=> a | `sortable`: A `GtkTreeSortable`
-> m (Bool, Int32, SortType) | Returns: `True` if the sort column is not one of the special sort column ids.

Deprecated: (Since version 4.10)

Fills in `sortColumnId` and `order` with the current sort column and the order. It returns `True` unless the `sortColumnId` is `TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID` or `TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID`.

## hasDefaultSortFunc

treeSortableHasDefaultSortFunc Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeSortable a) |
=> a | `sortable`: A `GtkTreeSortable`
-> m Bool | Returns: `True`, if the model has a default sort function

Deprecated: (Since version 4.10)

Returns `True` if the model has a default sort function. This is used primarily by GtkTreeViewColumns in order to determine if a model can go back to the default state, or not.

## setDefaultSortFunc

treeSortableSetDefaultSortFunc Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeSortable a) |
=> a | `sortable`: A `GtkTreeSortable`
-> TreeIterCompareFunc | `sortFunc`: The comparison function
-> m () |

Deprecated: (Since version 4.10)

Sets the default comparison function used when sorting to be `sortFunc`. If the current sort column id of `sortable` is `TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID`, then the model will sort using this function.

If `sortFunc` is `Nothing`, then there will be no default comparison function. This means that once the model has been sorted, it can’t go back to the default state. In this case, when the current sort column id of `sortable` is `TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID`, the model will be unsorted.

## setSortColumnId

treeSortableSetSortColumnId Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeSortable a) |
=> a | `sortable`: A `GtkTreeSortable`
-> Int32 | `sortColumnId`: the sort column id to set
-> SortType | `order`: The sort order of the column
-> m () |

Deprecated: (Since version 4.10)

Sets the current sort column to be `sortColumnId`. The `sortable` will resort itself to reflect this change, after emitting a `GtkTreeSortable::sort-column-changed` signal. `sortColumnId` may either be a regular column id, or one of the following special values:

- `TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID`: the default sort function will be used, if it is set
- `TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID`: no sorting will occur

## setSortFunc

treeSortableSetSortFunc Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeSortable a) |
=> a | `sortable`: A `GtkTreeSortable`
-> Int32 | `sortColumnId`: the sort column id to set the function for
-> TreeIterCompareFunc | `sortFunc`: The comparison function
-> m () |

Deprecated: (Since version 4.10)

Sets the comparison function used when sorting to be `sortFunc`. If the current sort column id of `sortable` is the same as `sortColumnId`, then the model will sort using this function.

## sortColumnChanged

treeSortableSortColumnChanged Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeSortable a) |
=> a | `sortable`: A `GtkTreeSortable`
-> m () |

Deprecated: (Since version 4.10)

Emits a `GtkTreeSortable::sort-column-changed` signal on `sortable`.

# Signals

## sortColumnChanged

type TreeSortableSortColumnChangedCallback = IO () Source #

The sortColumnChanged signal is emitted when the sort column or sort order of `sortable` is changed. The signal is emitted before the contents of `sortable` are resorted.

afterTreeSortableSortColumnChanged :: (IsTreeSortable a, MonadIO m) => a -> ((?self :: a) => TreeSortableSortColumnChangedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the sortColumnChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after treeSortable #sortColumnChanged callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onTreeSortableSortColumnChanged :: (IsTreeSortable a, MonadIO m) => a -> ((?self :: a) => TreeSortableSortColumnChangedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the sortColumnChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on treeSortable #sortColumnChanged callback