[Python-checkins] r73090 - python/branches/tk_and_idle_maintenance/Lib/lib-tk/ttk.py

guilherme.polo python-checkins at python.org
Mon Jun 1 03:45:08 CEST 2009


Author: guilherme.polo
Date: Mon Jun  1 03:45:08 2009
New Revision: 73090

Log:
Added support for passing keyword arguments in setup_master.

Modified:
   python/branches/tk_and_idle_maintenance/Lib/lib-tk/ttk.py

Modified: python/branches/tk_and_idle_maintenance/Lib/lib-tk/ttk.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/lib-tk/ttk.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/lib-tk/ttk.py	Mon Jun  1 03:45:08 2009
@@ -349,16 +349,18 @@
 
     return adict
 
-def setup_master(master=None):
+def setup_master(master=None, **kw):
     """If master is not None, itself is returned. If master is None,
     the default master is returned if there is one, otherwise a new
-    master is created and returned.
+    master is created, defined as default and then returned. Any
+    other passed options will be repassed to the Tkinter.Tk class.
 
     If it is not allowed to use the default root and master is None,
     RuntimeError is raised."""
     if master is None:
         if Tkinter._support_default_root:
-            master = Tkinter._default_root or Tkinter.Tk()
+            master = Tkinter._default_root or Tkinter.Tk(**kw)
+            Tkinter._default_root = master
         else:
             raise RuntimeError(
                     "No master specified and Tkinter is "


More information about the Python-checkins mailing list