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

Contents

- Exported types
- Methods
  - new

Description

An expression using a custom `GClosure` to compute the value from its parameters.

Synopsis

- newtype ClosureExpression = ClosureExpression (ManagedPtr ClosureExpression)
- class (BoxedPtr o, TypedObject o, IsDescendantOf ClosureExpression o) => IsClosureExpression o
- toClosureExpression :: (MonadIO m, IsClosureExpression o) => o -> m ClosureExpression
- closureExpressionNew :: (HasCallStack, MonadIO m) => GType -> GClosure a -> Maybe [Expression] -> m ClosureExpression

# Exported types

newtype ClosureExpression Source #

Memory-managed wrapper type.

Constructors

ClosureExpression (ManagedPtr ClosureExpression) |

#### Instances

Instances details

Eq ClosureExpression Source # |
Instance details Defined in GI.Gtk.Objects.ClosureExpression Methods (==) :: ClosureExpression -> ClosureExpression -> Bool Source # (/=) :: ClosureExpression -> ClosureExpression -> Bool Source #
BoxedPtr ClosureExpression Source # |
Instance details Defined in GI.Gtk.Objects.ClosureExpression Methods boxedPtrCopy :: ClosureExpression -> IO ClosureExpression Source # boxedPtrFree :: ClosureExpression -> IO () Source #
ManagedPtrNewtype ClosureExpression Source # |
Instance details Defined in GI.Gtk.Objects.ClosureExpression Methods toManagedPtr :: ClosureExpression -> ManagedPtr ClosureExpression Source #
TypedObject ClosureExpression Source # |
Instance details Defined in GI.Gtk.Objects.ClosureExpression Methods glibType :: IO GType Source #
HasParentTypes ClosureExpression Source # |
Instance details Defined in GI.Gtk.Objects.ClosureExpression
type ParentTypes ClosureExpression Source # |
Instance details Defined in GI.Gtk.Objects.ClosureExpression type ParentTypes ClosureExpression = '[Expression]

class (BoxedPtr o, TypedObject o, IsDescendantOf ClosureExpression o) => IsClosureExpression o Source #

Type class for types which can be safely cast to `ClosureExpression`, for instance with `toClosureExpression`.

#### Instances

Instances details

(BoxedPtr o, TypedObject o, IsDescendantOf ClosureExpression o) => IsClosureExpression o Source # |
Instance details Defined in GI.Gtk.Objects.ClosureExpression

toClosureExpression :: (MonadIO m, IsClosureExpression o) => o -> m ClosureExpression Source #

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

bind, evaluate, isStatic, ref, unref, watch.

#### Getters

getValueType.

#### Setters

None.

## new

closureExpressionNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> GType | `valueType`: the type of the value that this expression evaluates to
-> GClosure a | `closure`: closure to call when evaluating this expression. If closure is floating, it is adopted
-> Maybe [Expression] | `params`: expressions for each parameter
-> m ClosureExpression | Returns: a new `GtkExpression`

Creates a `GtkExpression` that calls `closure` when it is evaluated.

`closure` is called with the `this` object and the results of evaluating the `params` expressions.