Skip to content

Gtk.ClosureExpression

class — extends Expression

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

Constructors

new

@classmethod
def new(cls, value_type: type | GObject.Type, closure: GObject.Closure, params: list[Expression] | 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