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

GI.Gtk.Objects.NumericSorter

Description

GtkNumericSorter is a Sorter that compares numbers.

To obtain the numbers to compare, this sorter evaluates a Expression.

Synopsis

Exported types

newtype NumericSorter Source #

Memory-managed wrapper type.

Constructors

NumericSorter (ManagedPtr NumericSorter) 

Instances

Instances details
Eq NumericSorter Source # 
Instance details

Defined in GI.Gtk.Objects.NumericSorter

GObject NumericSorter Source # 
Instance details

Defined in GI.Gtk.Objects.NumericSorter

ManagedPtrNewtype NumericSorter Source # 
Instance details

Defined in GI.Gtk.Objects.NumericSorter

Methods

toManagedPtr :: NumericSorter -> ManagedPtr NumericSorter

TypedObject NumericSorter Source # 
Instance details

Defined in GI.Gtk.Objects.NumericSorter

Methods

glibType :: IO GType

HasParentTypes NumericSorter Source # 
Instance details

Defined in GI.Gtk.Objects.NumericSorter

IsGValue (Maybe NumericSorter) Source #

Convert NumericSorter to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.NumericSorter

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe NumericSorter -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe NumericSorter)

type ParentTypes NumericSorter Source # 
Instance details

Defined in GI.Gtk.Objects.NumericSorter

type ParentTypes NumericSorter = '[Sorter, Object]

class (GObject o, IsDescendantOf NumericSorter o) => IsNumericSorter o Source #

Type class for types which can be safely cast to NumericSorter, for instance with toNumericSorter.

Instances

Instances details
(GObject o, IsDescendantOf NumericSorter o) => IsNumericSorter o Source # 
Instance details

Defined in GI.Gtk.Objects.NumericSorter

toNumericSorter :: (MonadIO m, IsNumericSorter o) => o -> m NumericSorter Source #

Cast to NumericSorter, for types for which this is known to be safe. For general casts, use castTo.

Methods

getExpression

numericSorterGetExpression Source #

Arguments

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

self: a NumericSorter

-> m (Maybe Expression)

Returns: a Expression, or Nothing

Gets the expression that is evaluated to obtain numbers from items.

getSortOrder

numericSorterGetSortOrder Source #

Arguments

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

self: a NumericSorter

-> m SortType

Returns: the order of the numbers

Gets whether this sorter will sort smaller numbers first.

new

numericSorterNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsExpression a) 
=> Maybe a

expression: The expression to evaluate

-> m NumericSorter

Returns: a new NumericSorter

Creates a new numeric sorter using the given expression.

Smaller numbers will be sorted first. You can call numericSorterSetSortOrder to change this.

setExpression

numericSorterSetExpression Source #

Arguments

:: (HasCallStack, MonadIO m, IsNumericSorter a, IsExpression b) 
=> a

self: a NumericSorter

-> Maybe b

expression: a Expression, or Nothing

-> m () 

Sets the expression that is evaluated to obtain numbers from items.

Unless an expression is set on self, the sorter will always compare items as invalid.

The expression must have a return type that can be compared numerically, such as G_TYPE_INT or G_TYPE_DOUBLE.

setSortOrder

numericSorterSetSortOrder Source #

Arguments

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

self: a NumericSorter

-> SortType

sortOrder: whether to sort smaller numbers first

-> m () 

Sets whether to sort smaller numbers before larger ones.

Properties

expression

The expression to evaluate on items to get a number to compare with

clearNumericSorterExpression :: (MonadIO m, IsNumericSorter o) => o -> m () Source #

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

clear #expression

constructNumericSorterExpression :: (IsNumericSorter o, MonadIO m, IsExpression a) => a -> m (GValueConstruct o) Source #

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

getNumericSorterExpression :: (MonadIO m, IsNumericSorter o) => o -> m (Maybe Expression) Source #

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

get numericSorter #expression

setNumericSorterExpression :: (MonadIO m, IsNumericSorter o, IsExpression a) => o -> a -> m () Source #

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

set numericSorter [ #expression := value ]

sortOrder

Whether the sorter will sort smaller numbers first

constructNumericSorterSortOrder :: (IsNumericSorter o, MonadIO m) => SortType -> m (GValueConstruct o) Source #

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

getNumericSorterSortOrder :: (MonadIO m, IsNumericSorter o) => o -> m SortType Source #

Get the value of the “sort-order” property. When overloading is enabled, this is equivalent to

get numericSorter #sortOrder

setNumericSorterSortOrder :: (MonadIO m, IsNumericSorter o) => o -> SortType -> m () Source #

Set the value of the “sort-order” property. When overloading is enabled, this is equivalent to

set numericSorter [ #sortOrder := value ]