Don't reference removed files in Makefile
[python/dscho.git] / Lib / tkinter / Dialog.py
blob022bd96a76a293a53fcce961348326467cb2a01e
1 # Dialog.py -- Tkinter interface to the tk_dialog script.
2 from Tkinter import *
4 class Dialog(Widget):
5 def __init__(self, master=None, cnf={}):
6 Widget._setup(self, master, cnf)
7 self.num = self.tk.getint(
8 apply(self.tk.call,
9 ('tk_dialog', self._w,
10 cnf['title'], cnf['text'],
11 cnf['bitmap'], cnf['default'])
12 + cnf['strings']))
13 try: Widget.destroy(self)
14 except TclError: pass
15 def destroy(self): pass
17 def _test():
18 d = Dialog(None, {'title': 'File Modified',
19 'text':
20 'File "Python.h" has been modified'
21 ' since the last time it was saved.'
22 ' Do you want to save it before'
23 ' exiting the application.',
24 'bitmap': 'warning',
25 'default': 0,
26 'strings': ('Save File',
27 'Discard Changes',
28 'Return to Editor')})
29 print d.num
32 if __name__ == '__main__':
33 t = Button(None, {'text': 'Test',
34 'command': _test,
35 Pack: {}})
36 q = Button(None, {'text': 'Quit',
37 'command': t.quit,
38 Pack: {}})
39 t.mainloop()