summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2009-03-30 16:22:00 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2009-03-30 16:22:00 (GMT)
commitce46511957740aa9963b95db80c764b6c346fb1d (patch)
tree3ee2419f92ef6afa3f7a33634e6536a329e7975f /Lib
parent8ba6f3baf6e05fdc370bb2a9b5299df2b5f8388f (diff)
downloadcpython-ce46511957740aa9963b95db80c764b6c346fb1d.zip
cpython-ce46511957740aa9963b95db80c764b6c346fb1d.tar.gz
cpython-ce46511957740aa9963b95db80c764b6c346fb1d.tar.bz2
Tk 8.5 Text widget requires 'wordprocessor' tabstyle attr to handle mixed space/tab properly. Issue 5120, patch by Guilherme Polo.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/idlelib/EditorWindow.py16
-rw-r--r--Lib/idlelib/NEWS.txt3
2 files changed, 15 insertions, 4 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index 5848c02..6e1d6f6 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -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()
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index 965a8c1..6f912e8 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -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