404

[ Avaa Bypassed ]




Upload:

Command:

botdev@18.219.32.237: ~ $
# 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

Filemanager

Name Type Size Permission Actions
Canvas.py File 7.29 KB 0644
Canvas.pyc File 15.04 KB 0644
Dialog.py File 1.53 KB 0644
Dialog.pyc File 1.87 KB 0644
FileDialog.py File 8.62 KB 0644
FileDialog.pyc File 9.45 KB 0644
FixTk.py File 2.95 KB 0644
FixTk.pyc File 2.04 KB 0644
ScrolledText.py File 1.79 KB 0644
ScrolledText.pyc File 2.59 KB 0644
SimpleDialog.py File 3.64 KB 0644
SimpleDialog.pyc File 4.22 KB 0644
Tix.py File 75.41 KB 0644
Tix.pyc File 93.19 KB 0644
Tkconstants.py File 1.46 KB 0644
Tkconstants.pyc File 2.19 KB 0644
Tkdnd.py File 11.22 KB 0644
Tkdnd.pyc File 12.47 KB 0644
Tkinter.py File 156.91 KB 0644
Tkinter.pyc File 194.52 KB 0644
tkColorChooser.py File 1.74 KB 0644
tkColorChooser.pyc File 1.38 KB 0644
tkCommonDialog.py File 1.38 KB 0644
tkCommonDialog.pyc File 1.47 KB 0644
tkFileDialog.py File 5.59 KB 0644
tkFileDialog.pyc File 5.01 KB 0644
tkFont.py File 6.02 KB 0644
tkFont.pyc File 6.96 KB 0644
tkMessageBox.py File 3.6 KB 0644
tkMessageBox.pyc File 3.78 KB 0644
tkSimpleDialog.py File 7.54 KB 0644
tkSimpleDialog.pyc File 8.85 KB 0644
ttk.py File 54.86 KB 0644
ttk.pyc File 60.89 KB 0644
turtle.py File 135.78 KB 0644
turtle.pyc File 135.85 KB 0644