home *** CD-ROM | disk | FTP | other *** search
/ PC Extra 07 & 08 / pca1507.iso / Software / psp8 / Data1.cab / tkCommonDialog.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2003-04-22  |  2.0 KB  |  50 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.2)
  3.  
  4. from Tkinter import *
  5. import os
  6.  
  7. class Dialog:
  8.     command = None
  9.     
  10.     def __init__(self, master = None, **options):
  11.         if TkVersion < 4.2000000000000002:
  12.             raise TclError, 'this module requires Tk 4.2 or newer'
  13.         
  14.         self.master = master
  15.         self.options = options
  16.         if not master and options.get('parent'):
  17.             self.master = options['parent']
  18.         
  19.  
  20.     
  21.     def _fixoptions(self):
  22.         pass
  23.  
  24.     
  25.     def _fixresult(self, widget, result):
  26.         return result
  27.  
  28.     
  29.     def show(self, **options):
  30.         for k, v in options.items():
  31.             self.options[k] = v
  32.         
  33.         self._fixoptions()
  34.         w = Frame(self.master)
  35.         
  36.         try:
  37.             s = apply(w.tk.call, (self.command,) + w._options(self.options))
  38.             s = self._fixresult(w, s)
  39.         finally:
  40.             
  41.             try:
  42.                 w.destroy()
  43.             except:
  44.                 pass
  45.  
  46.  
  47.         return s
  48.  
  49.  
  50.