|
@@ -9,11 +9,13 @@ class Button(Element):
|
|
text: str = '',
|
|
text: str = '',
|
|
*,
|
|
*,
|
|
on_click: Callable = None,
|
|
on_click: Callable = None,
|
|
|
|
+ after: Callable = None,
|
|
):
|
|
):
|
|
"""Button Element
|
|
"""Button Element
|
|
|
|
|
|
:param text: the label of the button
|
|
:param text: the label of the button
|
|
:param on_click: callback which is invoked when button is pressed
|
|
:param on_click: callback which is invoked when button is pressed
|
|
|
|
+ :param after: callback to be executed aftern button is pressed, e.g. to clean up before the next page update
|
|
"""
|
|
"""
|
|
|
|
|
|
view = jp.QButton(label=text, color='primary')
|
|
view = jp.QButton(label=text, color='primary')
|
|
@@ -21,6 +23,9 @@ class Button(Element):
|
|
if on_click is not None:
|
|
if on_click is not None:
|
|
view.on('click', handle_exceptions(provide_arguments(on_click)))
|
|
view.on('click', handle_exceptions(provide_arguments(on_click)))
|
|
|
|
|
|
|
|
+ if after is not None:
|
|
|
|
+ view.on('after', handle_exceptions(provide_arguments(after)))
|
|
|
|
+
|
|
super().__init__(view)
|
|
super().__init__(view)
|
|
|
|
|
|
@property
|
|
@property
|