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.

Example:

with ButtonView(
    on_click=handle_click,
):
    Icon(name="share")
    Label(text="<i>Share the Content</i>")
../_images/button_view.png
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 either QMouseEvent or QKeyEvent. Use either this or on_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.