Popups¶
Display content in popup dialogs.
Basic¶
Call view()
with popup=True
to show the view on a popup window.
Set popup title¶
Set title=
to set a title for the popup window.
Customize buttons¶
If the popup's body contains a set of buttons, they're used as the popup's dismiss buttons. Common uses for such buttons are to accept, cancel or close a popup.
view(box(['Show a popup']))
response = view(
box('Call us now for free donuts!'),
box(options=dict(yes='Yes, now!', no='Maybe later')),
title='Wait!', popup=True,
)
if response == 'yes':
view('Your donuts are on the way!')
else:
view('No donuts for you.')