Skip to content

Gtk.ObjectExpression

class — extends Expression

A GObject value in a GtkExpression.

Constructors

new

@classmethod
def new(cls, object: GObject.Object) -> ObjectExpression

Creates an expression evaluating to the given object with a weak reference.

Once the object is disposed, it will fail to evaluate.

This expression is meant to break reference cycles.

If you want to keep a reference to object, use ConstantExpression.new.

Parameters:

  • object — object to watch

Methods

get_object

def get_object(self) -> GObject.Object | None

Gets the object that the expression evaluates to.