-
-
Notifications
You must be signed in to change notification settings - Fork 2
incendium.vision.gui.confirm
César Román edited this page Apr 30, 2024
·
9 revisions
Display a confirmation dialog box to the user.
This will present the user with "Yes", "No" and "Cancel" options, and a custom message.
Args:
- message (
str
): The message to display. This will be translated to the selected Locale. - title (
str
): A title for the message box. This will be translated to the selected Locale. Optional. Defaults to "Confirm". - show_cancel (
bool
): Show a cancel button in the dialog. Optional. Defaults toFalse
.
Returns:
-
bool
: True if the user selected "Yes", False if the user selected "No", None if the user selected "Cancel".
from __future__ import print_function
from incendium.vision import gui
message = "Would you like to continue without saving your changes?"
if gui.confirm(message, show_cancel=True):
# TODO: Handle the response.
print(1)