edifice.Button#

class edifice.Button(title='', **kwargs)[source]#

Bases: QtWidgetElement[QPushButton]

Basic button widget.

Props

All props from QtWidgetElement plus:

Parameters:

title (str) – The button text

Set the on_click prop (inherited from QtWidgetElement) to define the click behavior.

Usage

Button(title="Click me", on_click=lambda _: print("Clicked!"))
../_images/textinput_button.png

Button on the right#

Methods

__init__([title])

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.