Checkbox in widget/checkbox:5
The generic checkbox widget.
A checkbox is meant to be contained inside a window tag. It can have a label and can be checked or not checked.
This is a generic widget which will be converted into a specific widget, depending on the used GUI toolkit.
Class summary
This class offers 2 properties.
Property | Get | Set |
---|---|---|
disabled | Return whether the checkbox is disabled or not. | Can’t write |
enabled | Return whether the checkbox is enabled or not. | Can’t write |
This class offers 10 methods.
Method | Signature | Description |
---|---|---|
check | check() |
Force check this checkbox. |
create_specific | create_specific() |
Create the specific widget, using the specific_package attribute. |
disable | disable() |
Disable the checkbox. |
enable | enable() |
Force-enable the checkbox. |
handle_check | handle_check(control) |
Do nothing if a checkbox is clicked. |
handle_init | handle_init(control) |
Do nothing if a checkbox is pressed. |
handle_press | handle_press(control) |
Do nothing if a checkbox is pressed. |
schedule | schedule(coroutine) |
Schedule the specified coroutine in the main event loop. |
sleep | sleep(seconds) |
Asynchronous sleep during the specified number of seconds. |
uncheck | uncheck() |
Force uncheck this checkbox. |
Properties
disabled
This property can only get (read-only).
Get
Return whether the checkbox is disabled or not.
enabled
This property can only get (read-only).
Get
Return whether the checkbox is enabled or not.
Methods
check
check(self)
Parameter | Type | Default |
---|---|---|
self | Checkbox |
Force check this checkbox.
create_specific
create_specific(self)
Parameter | Type | Default |
---|---|---|
self | Checkbox |
Create the specific widget, using the specific_package
attribute.
If the specific object has already been created, don’t recreate it and raise no exception.
disable
disable(self)
Parameter | Type | Default |
---|---|---|
self | Checkbox |
Disable the checkbox.
enable
enable(self)
Parameter | Type | Default |
---|---|---|
self | Checkbox |
Force-enable the checkbox.
handle_check
handle_check(self, control)
Parameter | Type | Default |
---|---|---|
self | Checkbox |
|
control | Not set |
Do nothing if a checkbox is clicked.
handle_init
handle_init(self, control)
Parameter | Type | Default |
---|---|---|
self | Checkbox |
|
control | Not set |
Do nothing if a checkbox is pressed.
handle_press
handle_press(self, control)
Parameter | Type | Default |
---|---|---|
self | Checkbox |
|
control | Not set |
Do nothing if a checkbox is pressed.
schedule
schedule(self, coroutine)
Parameter | Type | Default |
---|---|---|
self | Checkbox |
|
coroutine | Not set |
Schedule the specified coroutine in the main event loop.
sleep
sleep(self, seconds)
Parameter | Type | Default |
---|---|---|
self | Checkbox |
|
seconds | Not set |
Asynchronous sleep during the specified number of seconds.
This method should ONLY be called in an asynchronous control method.
It is a shortcut to asyncio.sleep
.
Args: seconds (int or float): the number of seconds to wait.
uncheck
uncheck(self)
Parameter | Type | Default |
---|---|---|
self | Checkbox |
Force uncheck this checkbox.