Skip to content
This repository was archived by the owner on Sep 15, 2024. It is now read-only.

Variables

Kevin edited this page Jan 31, 2024 · 12 revisions

All variables inherit their attributes and methods from Variable. Unlike a regular variable, a variable that inherits from gobject.object is an object that emits a signal when its internal value changes. This allows for the use of dynamic content within widgets.

Variable

Variable inherits from GObject.Object

Constructor

Parameter Value Expected Default Value Description
initial_value any None The initial value of the variable can be of any type.

Methods

Method Arguments Type Description
set_value new_value Sets the internal value of the variable; when it changes, it emits a signal.
get_value Returns the internal value of the variable.
bind callback The callback argument must be callable. The bind method is used to connect to the variable. When the internal value of the variable changes, the callback is executed. By default, the new value is passed as an argument to the callback.
Clone this wiki locally