# base class for tk common dialogues # # this module provides a base class for accessing the common # dialogues available in Tk 4.2 and newer. use tkFileDialog, # tkColorChooser, and tkMessageBox to access the individual # dialogs. # # written by Fredrik Lundh, May 1997 # from Tkinter import * class Dialog: command = None def __init__(self, master=None, **options): # FIXME: should this be placed on the module level instead? if TkVersion < 4.2: raise TclError, "this module requires Tk 4.2 or newer" self.master = master self.options = options if not master and options.get('parent'): self.master = options['parent'] def _fixoptions(self): pass # hook def _fixresult(self, widget, result): return result # hook def show(self, **options): # update instance options for k, v in options.items(): self.options[k] = v self._fixoptions() # we need a dummy widget to properly process the options # (at least as long as we use Tkinter 1.63) w = Frame(self.master) try: s = w.tk.call(self.command, *w._options(self.options)) s = self._fixresult(w, s) finally: try: # get rid of the widget w.destroy() except: pass return s
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
test | Folder | 0755 |
|
|
Canvas.py | File | 7.29 KB | 0644 |
|
Canvas.pyc | File | 15.2 KB | 0644 |
|
Canvas.pyo | File | 15.2 KB | 0644 |
|
Dialog.py | File | 1.53 KB | 0644 |
|
Dialog.pyc | File | 1.88 KB | 0644 |
|
Dialog.pyo | File | 1.88 KB | 0644 |
|
FileDialog.py | File | 8.62 KB | 0644 |
|
FileDialog.pyc | File | 9.49 KB | 0644 |
|
FileDialog.pyo | File | 9.49 KB | 0644 |
|
FixTk.py | File | 2.95 KB | 0644 |
|
FixTk.pyc | File | 2.04 KB | 0644 |
|
FixTk.pyo | File | 1.98 KB | 0644 |
|
ScrolledText.py | File | 1.79 KB | 0644 |
|
ScrolledText.pyc | File | 2.6 KB | 0644 |
|
ScrolledText.pyo | File | 2.6 KB | 0644 |
|
SimpleDialog.py | File | 3.64 KB | 0644 |
|
SimpleDialog.pyc | File | 4.24 KB | 0644 |
|
SimpleDialog.pyo | File | 4.24 KB | 0644 |
|
Tix.py | File | 75.41 KB | 0644 |
|
Tix.pyc | File | 93.84 KB | 0644 |
|
Tix.pyo | File | 93.84 KB | 0644 |
|
Tkconstants.py | File | 1.46 KB | 0644 |
|
Tkconstants.pyc | File | 2.19 KB | 0644 |
|
Tkconstants.pyo | File | 2.19 KB | 0644 |
|
Tkdnd.py | File | 11.22 KB | 0644 |
|
Tkdnd.pyc | File | 12.52 KB | 0644 |
|
Tkdnd.pyo | File | 12.52 KB | 0644 |
|
Tkinter.py | File | 156.85 KB | 0644 |
|
Tkinter.pyc | File | 195.5 KB | 0644 |
|
Tkinter.pyo | File | 195.5 KB | 0644 |
|
tkColorChooser.py | File | 1.74 KB | 0644 |
|
tkColorChooser.pyc | File | 1.39 KB | 0644 |
|
tkColorChooser.pyo | File | 1.39 KB | 0644 |
|
tkCommonDialog.py | File | 1.38 KB | 0644 |
|
tkCommonDialog.pyc | File | 1.48 KB | 0644 |
|
tkCommonDialog.pyo | File | 1.48 KB | 0644 |
|
tkFileDialog.py | File | 5.59 KB | 0644 |
|
tkFileDialog.pyc | File | 5.04 KB | 0644 |
|
tkFileDialog.pyo | File | 5.04 KB | 0644 |
|
tkFont.py | File | 6.02 KB | 0644 |
|
tkFont.pyc | File | 7 KB | 0644 |
|
tkFont.pyo | File | 7 KB | 0644 |
|
tkMessageBox.py | File | 3.6 KB | 0644 |
|
tkMessageBox.pyc | File | 3.8 KB | 0644 |
|
tkMessageBox.pyo | File | 3.8 KB | 0644 |
|
tkSimpleDialog.py | File | 7.54 KB | 0644 |
|
tkSimpleDialog.pyc | File | 8.9 KB | 0644 |
|
tkSimpleDialog.pyo | File | 8.9 KB | 0644 |
|
ttk.py | File | 54.86 KB | 0644 |
|
ttk.pyc | File | 61.16 KB | 0644 |
|
ttk.pyo | File | 61.16 KB | 0644 |
|
turtle.py | File | 135.78 KB | 0644 |
|
turtle.pyc | File | 136.31 KB | 0644 |
|
turtle.pyo | File | 136.31 KB | 0644 |
|