edifice.ButtonView#
- class edifice.ButtonView(on_trigger=None, **kwargs)[source]#
Bases:
HBoxView
A Button where the label is the Button’s children rendered in a
edifice.HBoxView
.Underlying Qt Widget QPushButton
Example:
with ButtonView( on_click=handle_click, ): Icon(name="share") Label(text="<i>Share the Content</i>")
- Parameters:
on_trigger (
Union
[Callable
[[QKeyEvent
],None
],Callable
[[QMouseEvent
],None
],None
]) – Event fires when the button is triggered by mouse or the Spacebar or Enter key. Event type is eitherQMouseEvent
orQKeyEvent
. Use either this oron_click
, not both.
Methods
__init__
([on_trigger])register_ref
(reference)Registers provided
Reference
to this Element.set_key
(key)Set the key of an
Element
.Attributes
children
The children of this Element.
props
The props of this Element.
underlying
The underlying QWidget, which may not exist if this Element has not rendered.