gi-gtk-3.0.34: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Interfaces.TreeSortable

Description

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

Synopsis

Exported types

newtype TreeSortable Source #

Memory-managed wrapper type.

Constructors

TreeSortable (ManagedPtr TreeSortable) 

Instances

Instances details
Eq TreeSortable Source # 
Instance details

Defined in GI.Gtk.Interfaces.TreeSortable

Methods

(==) :: TreeSortable -> TreeSortable -> Bool

(/=) :: TreeSortable -> TreeSortable -> Bool

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

TypedObject TreeSortable Source # 
Instance details

Defined in GI.Gtk.Interfaces.TreeSortable

Methods

glibType :: IO GType

IsGValue TreeSortable Source #

Convert TreeSortable to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Interfaces.TreeSortable

Methods

toGValue :: TreeSortable -> IO GValue

fromGValue :: GValue -> IO TreeSortable

HasParentTypes TreeSortable Source # 
Instance details

Defined in GI.Gtk.Interfaces.TreeSortable

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

Overloaded methods

getSortColumnId

treeSortableGetSortColumnId Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeSortable a) 
=> a

sortable: A TreeSortable

-> m (Bool, Int32, SortType)

Returns: True if the sort column is not one of the special sort column ids.

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 TreeSortable

-> m Bool

Returns: True, if the model has a default sort function

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 TreeSortable

-> TreeIterCompareFunc

sortFunc: The comparison function

-> m () 

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 TreeSortable

-> Int32

sortColumnId: the sort column id to set

-> SortType

order: The sort order of the column

-> m () 

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

setSortFunc

treeSortableSetSortFunc Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeSortable a) 
=> a

sortable: A TreeSortable

-> Int32

sortColumnId: the sort column id to set the function for

-> TreeIterCompareFunc

sortFunc: The comparison function

-> m () 

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 TreeSortable

-> m () 

Emits a sortColumnChanged signal on sortable.

Signals

sortColumnChanged

type C_TreeSortableSortColumnChangedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

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

onTreeSortableSortColumnChanged :: (IsTreeSortable a, MonadIO m) => 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