Button classes¶
Simple example:
b = ui.Button(text="Push me")
Also see examples: buttons.py.
-
class
flexx.ui.BaseButton(*init_args, **kwargs)¶ Inherits from:
WidgetAbstract button class.
properties: checked, disabled, text
emitters: user_checked
actions: set_checked, set_disabled, set_text
-
checked¶ BoolProp – Whether the button is checked.
-
disabled¶ BoolProp – Whether the button is disabled.
-
set_checked(*val)¶ action – Setter for the ‘checked’ property.
-
set_disabled(*val)¶ action – Setter for the ‘disabled’ property.
-
set_text(*val)¶ action – Setter for the ‘text’ property.
-
text¶ StringProp – The text on the button.
-
user_checked(checked)¶ emitter – Event emitted when the user (un)checks this button. Has
old_valueandnew_valueattributes.
-
-
class
flexx.ui.Button(*init_args, **kwargs)¶ Inherits from:
BaseButtonA push button.
The
nodeof this widget is a <button>.
-
class
flexx.ui.CheckBox(*init_args, **kwargs)¶ Inherits from:
BaseButtonA checkbox button.
The
outernodeof this widget is a <label>, and thenodea checkbox <input>.
-
class
flexx.ui.RadioButton(*init_args, **kwargs)¶ Inherits from:
BaseButtonA radio button. Of any group of radio buttons that share the same parent, only one can be active.
The
outernodeof this widget is a <label>, and thenodea radio <input>.emitters: pointer_click
-
pointer_click(e)¶ emitter – This method is called on JS a click event. We first update the checked properties, and then emit the Flexx click event. That way, one can connect to the click event and have an up-to-date checked props (even on Py).
-
-
class
flexx.ui.ToggleButton(*init_args, **kwargs)¶ Inherits from:
BaseButtonA button that can be toggled. It behaves like a checkbox, while looking more like a regular button.
The
nodeof this widget is a <button>.-
JS¶ alias of
ToggleButton
-