[Python-checkins] r63885 - sandbox/trunk/ttk-gsoc/src/idlelib_ttk.diff

guilherme.polo python-checkins at python.org
Mon Jun 2 03:59:39 CEST 2008


Author: guilherme.polo
Date: Mon Jun  2 03:59:39 2008
New Revision: 63885

Log:
New idlelib uses the just added ttk OptionMenu at dynOptionMenu now.

Modified:
   sandbox/trunk/ttk-gsoc/src/idlelib_ttk.diff

Modified: sandbox/trunk/ttk-gsoc/src/idlelib_ttk.diff
==============================================================================
--- sandbox/trunk/ttk-gsoc/src/idlelib_ttk.diff	(original)
+++ sandbox/trunk/ttk-gsoc/src/idlelib_ttk.diff	Mon Jun  2 03:59:39 2008
@@ -1,6 +1,6 @@
 Index: Lib/idlelib/AutoCompleteWindow.py
 ===================================================================
---- Lib/idlelib/AutoCompleteWindow.py	(revision 63734)
+--- Lib/idlelib/AutoCompleteWindow.py	(revision 63867)
 +++ Lib/idlelib/AutoCompleteWindow.py	(working copy)
 @@ -4,7 +4,11 @@
  from Tkinter import *
@@ -16,7 +16,7 @@
  KEYPRESS_VIRTUAL_EVENT_NAME = "<<autocompletewindow-keypress>>"
 Index: Lib/idlelib/ToolTip.py
 ===================================================================
---- Lib/idlelib/ToolTip.py	(revision 63734)
+--- Lib/idlelib/ToolTip.py	(revision 63867)
 +++ Lib/idlelib/ToolTip.py	(working copy)
 @@ -3,7 +3,8 @@
  # may be useful for some purposes in (or almost in ;) the current project scope
@@ -28,6 +28,33 @@
  
  class ToolTipBase:
  
+Index: Lib/idlelib/configSectionNameDialog.py
+===================================================================
+--- Lib/idlelib/configSectionNameDialog.py	(revision 63867)
++++ Lib/idlelib/configSectionNameDialog.py	(working copy)
+@@ -4,7 +4,12 @@
+ """
+ from Tkinter import *
+ import tkMessageBox
++from idlelib.configHandler import idleConf
+ 
++TTK = idleConf.GetOption('main', 'General', 'use-ttk', type='int')
++if TTK:
++    from ttk import *
++
+ class GetCfgSectionNameDialog(Toplevel):
+     def __init__(self,parent,title,message,usedNames):
+         """
+@@ -55,6 +60,9 @@
+                 width=8,command=self.Cancel)
+         self.buttonCancel.grid(row=0,column=1,padx=5,pady=5)
+ 
++        if TTK:
++            frameButton['style'] = 'RootColor.TFrame'
++
+     def NameOk(self):
+         #simple validity check for a sensible
+         #ConfigParser file section name
 Index: Lib/idlelib/stylist.py
 ===================================================================
 --- Lib/idlelib/stylist.py	(revision 0)
@@ -62,36 +89,9 @@
 +            return
 +
 +        w.configure(**self.styles[style])
-Index: Lib/idlelib/configSectionNameDialog.py
-===================================================================
---- Lib/idlelib/configSectionNameDialog.py	(revision 63734)
-+++ Lib/idlelib/configSectionNameDialog.py	(working copy)
-@@ -4,7 +4,12 @@
- """
- from Tkinter import *
- import tkMessageBox
-+from idlelib.configHandler import idleConf
- 
-+TTK = idleConf.GetOption('main', 'General', 'use-ttk', type='int')
-+if TTK:
-+    from ttk import *
-+
- class GetCfgSectionNameDialog(Toplevel):
-     def __init__(self,parent,title,message,usedNames):
-         """
-@@ -55,6 +60,9 @@
-                 width=8,command=self.Cancel)
-         self.buttonCancel.grid(row=0,column=1,padx=5,pady=5)
- 
-+        if TTK:
-+            frameButton['style'] = 'RootColor.TFrame'
-+
-     def NameOk(self):
-         #simple validity check for a sensible
-         #ConfigParser file section name
 Index: Lib/idlelib/PyShell.py
 ===================================================================
---- Lib/idlelib/PyShell.py	(revision 63734)
+--- Lib/idlelib/PyShell.py	(revision 63867)
 +++ Lib/idlelib/PyShell.py	(working copy)
 @@ -22,14 +22,26 @@
      print>>sys.__stderr__, "** IDLE can't import Tkinter.  " \
@@ -143,7 +143,7 @@
      flist = PyShellFileList(root)
 Index: Lib/idlelib/Debugger.py
 ===================================================================
---- Lib/idlelib/Debugger.py	(revision 63734)
+--- Lib/idlelib/Debugger.py	(revision 63867)
 +++ Lib/idlelib/Debugger.py	(working copy)
 @@ -4,8 +4,11 @@
  from Tkinter import *
@@ -175,7 +175,7 @@
          self.repr.maxstring = 60
 Index: Lib/idlelib/configDialog.py
 ===================================================================
---- Lib/idlelib/configDialog.py	(revision 63734)
+--- Lib/idlelib/configDialog.py	(revision 63867)
 +++ Lib/idlelib/configDialog.py	(working copy)
 @@ -7,7 +7,6 @@
  
@@ -396,7 +396,7 @@
          if self.themeIsBuiltin.get(): #a default theme
 Index: Lib/idlelib/ReplaceDialog.py
 ===================================================================
---- Lib/idlelib/ReplaceDialog.py	(revision 63734)
+--- Lib/idlelib/ReplaceDialog.py	(revision 63867)
 +++ Lib/idlelib/ReplaceDialog.py	(working copy)
 @@ -11,9 +11,12 @@
      dialog.open(text)
@@ -430,7 +430,7 @@
          self.do_find(0)
 Index: Lib/idlelib/tabbedpages.py
 ===================================================================
---- Lib/idlelib/tabbedpages.py	(revision 63734)
+--- Lib/idlelib/tabbedpages.py	(revision 63867)
 +++ Lib/idlelib/tabbedpages.py	(working copy)
 @@ -1,490 +1,4 @@
 -"""An implementation of tabbed pages using only standard Tkinter.
@@ -929,7 +929,7 @@
 +    from idlelib.tabbedpages_old import TabbedPageSet
 Index: Lib/idlelib/keybindingDialog.py
 ===================================================================
---- Lib/idlelib/keybindingDialog.py	(revision 63734)
+--- Lib/idlelib/keybindingDialog.py	(revision 63867)
 +++ Lib/idlelib/keybindingDialog.py	(working copy)
 @@ -5,6 +5,12 @@
  import tkMessageBox
@@ -956,7 +956,7 @@
  
 Index: Lib/idlelib/configHelpSourceEdit.py
 ===================================================================
---- Lib/idlelib/configHelpSourceEdit.py	(revision 63734)
+--- Lib/idlelib/configHelpSourceEdit.py	(revision 63867)
 +++ Lib/idlelib/configHelpSourceEdit.py	(working copy)
 @@ -6,7 +6,12 @@
  from Tkinter import *
@@ -997,7 +997,7 @@
              ("HTML Files", "*.htm *.html", "TEXT"),
 Index: Lib/idlelib/GrepDialog.py
 ===================================================================
---- Lib/idlelib/GrepDialog.py	(revision 63734)
+--- Lib/idlelib/GrepDialog.py	(revision 63867)
 +++ Lib/idlelib/GrepDialog.py	(working copy)
 @@ -4,7 +4,11 @@
  from Tkinter import *
@@ -1058,7 +1058,7 @@
 -            self.top.withdraw()
 Index: Lib/idlelib/EditorWindow.py
 ===================================================================
---- Lib/idlelib/EditorWindow.py	(revision 63734)
+--- Lib/idlelib/EditorWindow.py	(revision 63867)
 +++ Lib/idlelib/EditorWindow.py	(working copy)
 @@ -365,7 +365,7 @@
          self.menudict = menudict = {}
@@ -1071,7 +1071,7 @@
          if sys.platform == 'darwin' and '.framework' in sys.executable:
 Index: Lib/idlelib/aboutDialog.py
 ===================================================================
---- Lib/idlelib/aboutDialog.py	(revision 63734)
+--- Lib/idlelib/aboutDialog.py	(revision 63867)
 +++ Lib/idlelib/aboutDialog.py	(working copy)
 @@ -1,13 +1,17 @@
 -"""About Dialog for IDLE
@@ -1242,7 +1242,7 @@
  
 Index: Lib/idlelib/config-main.def
 ===================================================================
---- Lib/idlelib/config-main.def	(revision 63734)
+--- Lib/idlelib/config-main.def	(revision 63867)
 +++ Lib/idlelib/config-main.def	(working copy)
 @@ -49,6 +49,7 @@
  print-command-posix=lpr %s
@@ -1254,7 +1254,7 @@
  width= 80
 Index: Lib/idlelib/IOBinding.py
 ===================================================================
---- Lib/idlelib/IOBinding.py	(revision 63734)
+--- Lib/idlelib/IOBinding.py	(revision 63867)
 +++ Lib/idlelib/IOBinding.py	(working copy)
 @@ -18,6 +18,9 @@
  
@@ -1268,7 +1268,7 @@
  except ImportError:
 Index: Lib/idlelib/ScrolledList.py
 ===================================================================
---- Lib/idlelib/ScrolledList.py	(revision 63734)
+--- Lib/idlelib/ScrolledList.py	(revision 63867)
 +++ Lib/idlelib/ScrolledList.py	(working copy)
 @@ -1,5 +1,9 @@
  from Tkinter import *
@@ -1282,7 +1282,7 @@
      default = "(None)"
 Index: Lib/idlelib/textView.py
 ===================================================================
---- Lib/idlelib/textView.py	(revision 63734)
+--- Lib/idlelib/textView.py	(revision 63867)
 +++ Lib/idlelib/textView.py	(working copy)
 @@ -1,10 +1,13 @@
 -"""Simple text browser for IDLE
@@ -1327,9 +1327,34 @@
      def Ok(self, event=None):
          self.destroy()
  
+Index: Lib/idlelib/CallTipWindow.py
+===================================================================
+--- Lib/idlelib/CallTipWindow.py	(revision 63867)
++++ Lib/idlelib/CallTipWindow.py	(working copy)
+@@ -5,7 +5,11 @@
+ 
+ """
+ from Tkinter import *
++from idlelib.configHandler import idleConf
+ 
++if idleConf.GetOption('main', 'General', 'use-ttk', type='int'):
++    from ttk import *
++
+ HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
+ HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")
+ CHECKHIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-checkhide>>"
+@@ -163,6 +167,8 @@
+     def calltip_hide(self, event):
+         self.calltip.hidetip()
+ 
++# XXX Bugged test
++
+ def main():
+     # Test code
+     c=container()
 Index: Lib/idlelib/SearchDialogBase.py
 ===================================================================
---- Lib/idlelib/SearchDialogBase.py	(revision 63734)
+--- Lib/idlelib/SearchDialogBase.py	(revision 63867)
 +++ Lib/idlelib/SearchDialogBase.py	(working copy)
 @@ -1,35 +1,40 @@
  from Tkinter import *
@@ -1532,34 +1557,9 @@
 +            btns[opts['text']] = Button(f, **opts).grid(row=self.row, padx=6,
 +                                                        pady=6, column=column)
 +            column += 1
-Index: Lib/idlelib/CallTipWindow.py
-===================================================================
---- Lib/idlelib/CallTipWindow.py	(revision 63734)
-+++ Lib/idlelib/CallTipWindow.py	(working copy)
-@@ -5,7 +5,11 @@
- 
- """
- from Tkinter import *
-+from idlelib.configHandler import idleConf
- 
-+if idleConf.GetOption('main', 'General', 'use-ttk', type='int'):
-+    from ttk import *
-+
- HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
- HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")
- CHECKHIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-checkhide>>"
-@@ -163,6 +167,8 @@
-     def calltip_hide(self, event):
-         self.calltip.hidetip()
- 
-+# XXX Bugged test
-+
- def main():
-     # Test code
-     c=container()
 Index: Lib/idlelib/SearchDialog.py
 ===================================================================
---- Lib/idlelib/SearchDialog.py	(revision 63734)
+--- Lib/idlelib/SearchDialog.py	(revision 63867)
 +++ Lib/idlelib/SearchDialog.py	(working copy)
 @@ -21,10 +21,10 @@
      return _setup(text).find_selection(text)
@@ -2071,7 +2071,7 @@
 +    root.mainloop()
 Index: Lib/idlelib/TreeWidget.py
 ===================================================================
---- Lib/idlelib/TreeWidget.py	(revision 63734)
+--- Lib/idlelib/TreeWidget.py	(revision 63867)
 +++ Lib/idlelib/TreeWidget.py	(working copy)
 @@ -21,6 +21,12 @@
  import ZoomHeight
@@ -2198,9 +2198,9 @@
 +    root.mainloop()
 Index: Lib/idlelib/dynOptionMenuWidget.py
 ===================================================================
---- Lib/idlelib/dynOptionMenuWidget.py	(revision 63734)
+--- Lib/idlelib/dynOptionMenuWidget.py	(revision 63867)
 +++ Lib/idlelib/dynOptionMenuWidget.py	(working copy)
-@@ -2,34 +2,41 @@
+@@ -2,34 +2,38 @@
  OptionMenu widget modified to allow dynamic menu reconfiguration
  and setting of highlightthickness
  """
@@ -2212,7 +2212,7 @@
 +from configHandler import idleConf
 +TTK = idleConf.GetOption('main', 'General', 'use-ttk', type='int')
 +if TTK:
-+    from ttk import Style
++    from ttk import *
 +
  class DynOptionMenu(OptionMenu):
 -    """
@@ -2232,9 +2232,6 @@
 -        #self.menu=self['menu']
 -        self.variable=variable
 -        self.command=kwargs.get('command')
-+        if TTK: # XXX Ideally this should be a ttk Menubutton
-+            bg = Style(master).configure('.', 'background')
-+            self.configure(bg=bg, highlightbackground=bg)
  
 -    def SetMenu(self,valueList,value=None):
 +    def SetMenu(self, valueList, value=None):
@@ -2255,7 +2252,7 @@
              self.variable.set(value)
 Index: Lib/idlelib/MultiStatusBar.py
 ===================================================================
---- Lib/idlelib/MultiStatusBar.py	(revision 63734)
+--- Lib/idlelib/MultiStatusBar.py	(revision 63867)
 +++ Lib/idlelib/MultiStatusBar.py	(working copy)
 @@ -1,5 +1,9 @@
  from Tkinter import *


More information about the Python-checkins mailing list