Skip to content
Newer
Older
100644 57 lines (46 sloc) 1.77 KB
e569f09 * Moving the Envisage 2.1 version of PyFace to be the trunk of PyFace…
dpeterson authored
1 #------------------------------------------------------------------------------
2 # Copyright (c) 2005, Enthought, Inc.
3 # All rights reserved.
bd1352b converting to unix line endings and removing excess whitespace
Ilan Schnell authored
4 #
e569f09 * Moving the Envisage 2.1 version of PyFace to be the trunk of PyFace…
dpeterson authored
5 # This software is provided without warranty under the terms of the BSD
6 # license included in enthought/LICENSE.txt and may be redistributed only
7 # under the conditions described in the aforementioned license. The license
8 # is also available online at http://www.enthought.com/licenses/BSD.txt
9 # Thanks for using Enthought open source!
bd1352b converting to unix line endings and removing excess whitespace
Ilan Schnell authored
10 #
e569f09 * Moving the Envisage 2.1 version of PyFace to be the trunk of PyFace…
dpeterson authored
11 # Author: Enthought, Inc.
12 # Description: <Enthought pyface package component>
13 #------------------------------------------------------------------------------
3d01543 Changed the way that the toolkit backends are integrated so that it i…
phil authored
14 """ The implementation of a dialog that prompts the user for confirmation. """
e569f09 * Moving the Envisage 2.1 version of PyFace to be the trunk of PyFace…
dpeterson authored
15
2885023 @corranwebster Fix more future imports.
corranwebster authored
16 from __future__ import absolute_import
e569f09 * Moving the Envisage 2.1 version of PyFace to be the trunk of PyFace…
dpeterson authored
17
18 # Local imports.
13174c2 @corranwebster More fixes.
corranwebster authored
19 from .constant import NO
e569f09 * Moving the Envisage 2.1 version of PyFace to be the trunk of PyFace…
dpeterson authored
20
21
22 def confirm(parent, message, title=None, cancel=False, default=NO):
24d5654 @corranwebster More docstring improvements and EOF removal.
corranwebster authored
23 """ Convenience method to show a confirmation dialog.
24
25 Parameters
26 ----------
27 parent : toolkit widget or None
28 The parent control for the dialog.
29 message : str
30 The text of the message to display.
31 title : str
32 The text of the dialog title.
33 cancel : bool
34 ``True`` if the dialog should contain a Cancel button.
35 default : NO, YES or CANCEL
36 Which button should be the default button.
37 """
e569f09 * Moving the Envisage 2.1 version of PyFace to be the trunk of PyFace…
dpeterson authored
38 if title is None:
39 title = "Confirmation"
40
41 dialog = ConfirmationDialog(
42 parent = parent,
43 message = message,
44 cancel = cancel,
45 default = default,
46 title = title
47 )
48
49 return dialog.open()
50
51
3d01543 Changed the way that the toolkit backends are integrated so that it i…
phil authored
52 # Import the toolkit specific version.
665c35d @corranwebster Absolute toolkit imports.
corranwebster authored
53 from .toolkit import toolkit_object
3d01543 Changed the way that the toolkit backends are integrated so that it i…
phil authored
54 ConfirmationDialog = toolkit_object('confirmation_dialog:ConfirmationDialog')
e569f09 * Moving the Envisage 2.1 version of PyFace to be the trunk of PyFace…
dpeterson authored
55
56 #### EOF ######################################################################
Something went wrong with that request. Please try again.