1 # dialog.py -- Tkinter interface to the tk_dialog script.
4 from Tkinter
import _cnfmerge
7 DIALOG_ICON
= 'warning'
9 DIALOG_ICON
= 'questhead'
13 def __init__(self
, master
=None, cnf
={}, **kw
):
14 cnf
= _cnfmerge((cnf
, kw
))
15 self
.widgetName
= '__dialog__'
16 Widget
._setup
(self
, master
, cnf
)
17 self
.num
= self
.tk
.getint(
20 cnf
['title'], cnf
['text'],
21 cnf
['bitmap'], cnf
['default'],
23 try: Widget
.destroy(self
)
25 def destroy(self
): pass
28 d
= Dialog(None, {'title': 'File Modified',
30 'File "Python.h" has been modified'
31 ' since the last time it was saved.'
32 ' Do you want to save it before'
33 ' exiting the application.',
34 'bitmap': DIALOG_ICON
,
36 'strings': ('Save File',
42 if __name__
== '__main__':
43 t
= Button(None, {'text': 'Test',
46 q
= Button(None, {'text': 'Quit',