edifice.ButtonView#
- class edifice.ButtonView(on_trigger=None, **kwargs)[source]#
Bases:
HBoxViewButton with child layout.
A Button where the label is the Button’s children rendered in a
edifice.HBoxView.Underlying Qt Widget QPushButton
Props
All props from
QtWidgetElementplus:- Parameters:
on_trigger (
Optional[Callable[[QKeyEvent|QMouseEvent],None]]) –Event fires when the button is triggered by mouse or the Spacebar or Enter key. Event type is either QMouseEvent or QKeyEvent.
Use either this prop or
on_clickprop, not both.
Usage
Example ButtonView#with ButtonView( on_trigger=lambda _event: print("Button Triggered"), ): ImageSvg( src=str(importlib.resources.files(edifice) / "icons/font-awesome/solid/share.svg"), style={"width": 18, "height": 18 }, ) Label(text="<i>Share the Content</i>")
Methods
__init__([on_trigger])register_ref(reference)Registers provided
Referenceto this Element.set_key(key)Set the key of an
Element.Attributes
childrenThe children of this Element.
propsThe props of this Element.
underlyingThe underlying QWidget, which may not exist if this Element has not rendered.