ClosureExpression#

class ClosureExpression(*args, **kwargs)#

Superclasses: Expression

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

Constructors#

class ClosureExpression
classmethod new(value_type: type, closure: Callable[[...], Any], params: Sequence[Expression] | None = None) ClosureExpression#

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.

Parameters:
  • value_type – the type of the value that this expression evaluates to

  • closure – closure to call when evaluating this expression. If closure is floating, it is adopted

  • params – expressions for each parameter