This repository was archived by the owner on Sep 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
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 inherits from GObject.Object
Parameter | Value Expected | Default Value | Description |
---|---|---|---|
initial_value | any |
None | The initial value of the variable can be of any type. |
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. |