]> granicus.if.org Git - python/commitdiff
Tk 8.5 Text widget requires 'wordprocessor' tabstyle attr to handle mixed space/tab...
authorKurt B. Kaiser <kbk@shore.net>
Mon, 30 Mar 2009 16:22:00 +0000 (16:22 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Mon, 30 Mar 2009 16:22:00 +0000 (16:22 +0000)
Lib/idlelib/EditorWindow.py
Lib/idlelib/NEWS.txt

index 5848c0232ce5bb5e8feb79071266cc75c007c1a5..6e1d6f6ef944ebefb54ea16e79c91c1ac16609ef 100644 (file)
@@ -105,10 +105,18 @@ class EditorWindow(object):
         self.text_frame = text_frame = Frame(top)
         self.vbar = vbar = Scrollbar(text_frame, name='vbar')
         self.width = idleConf.GetOption('main','EditorWindow','width')
-        self.text = text = MultiCallCreator(Text)(
-                text_frame, name='text', padx=5, wrap='none',
-                width=self.width,
-                height=idleConf.GetOption('main','EditorWindow','height') )
+        text_options = {
+                'name': 'text',
+                'padx': 5,
+                'wrap': 'none',
+                'width': self.width,
+                'height': idleConf.GetOption('main', 'EditorWindow', 'height')}
+        if TkVersion >= 8.5:
+            # Starting with tk 8.5 we have to set the new tabstyle option
+            # to 'wordprocessor' to achieve the same display of tabs as in
+            # older tk versions.
+            text_options['tabstyle'] = 'wordprocessor'
+        self.text = text = MultiCallCreator(Text)(text_frame, **text_options)
         self.top.focused_widget = self.text
 
         self.createmenubar()
index 965a8c1f389371d3e51948172c45fa6769614b53..6f912e8bad99ac289877d704e58e31177d692852 100644 (file)
@@ -3,6 +3,9 @@ What's New in IDLE 2.7a0?
 
 *Release date: XX-XXX-2009*
 
+- Tk 8.5 Text widget requires 'wordprocessor' tabstyle attr to handle
+  mixed space/tab properly. Issue 5120, patch by Guilherme Polo.
+  
 - Issue #3549: On MacOS the preferences menu was not present