edifice.ButtonView

edifice.ButtonView#

class edifice.ButtonView(layout='row', on_trigger=None, **kwargs)[source]#

Bases: View

A Button where the label is the Button’s children rendered in a edifice.View.

Example:

with ButtonView(
    layout="row",
    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__([layout, on_trigger])

register_ref(reference)

Registers provided Reference to this Element.

set_key(key)

Sets the key of the 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.