Dialog Functions
In addition to the TaskDialog class, there are convenience functions that wrap
its functionality into a single call. Additionally, if the TaskDialog is not
available on the system, the functions will display an alternative dialog box
(although with not as much detail) so that the calling application does not break.
-
curtains.save_or_not_dialog([show_footer[, literature[, parenthwnd]]])
Display a dialog prompting the user to save changes in an application. The
dialog consists of Save, Don't Save and Cancel buttons.
Parameters: |
- show_footer – if this is set to True, a footer is displayed at the
bottom of the dialog with a warning icon.
- literature (python dictionary) –
a dictionary with values describing the text that the
dialog displays. The supported keys and their default
values are:
title - Window title of the dialog. Default to “Message”
heading - Defaults to “You have unsaved changes”
content - Defaults to “Do you want to save those changes before you continue?”
footer - Defaults to “Your changes will be lost if you don’t save them.”
save - Label of the save button. Defaults to “Save”
dontsave - Label of the don’t save button. Defaults to “Don’t Save”.
|
Returns: | Either SAVE, DONTSAVE or CANCEL indicating
which button the user pressed.
|
-
curtains.save_or_not_dialog_wx([show_footer[, literature[, parent]]])
Display a dialog prompting the user to save changes in a wxPython
application. The dialog consists of Save, Don't Save and Cancel
buttons.
Parameters: |
- parent (wx.TopLevelWindow or None) – The parent window of the dialog.
|
Calling this dialog with a parent has the side-effect of invoke the Show()
method on parent, as well as making the dialog modal to the parent window.
The dialog will also take the parent window’s title if no title is supplied
with literature.
See save_or_not_dialog() for other parameters and return type.
-
curtains.SAVE
- Constant returned when the user presses the designated save button in a
save/don’t save dialog.
-
curtains.DONTSAVE
- Constant returned when the user presses the dontsave button in a save/don’t
save dialog.
-
curtains.CANCEL
- Constant returned from a dialog function when a user cancels the dialog.