Mercurial > cpython-lru_cache-weakref
diff Lib/idlelib/EditorWindow.py @ 52447:42e87ff9f65d legacy-trunk
Tk 8.5 Text widget requires 'wordprocessor' tabstyle attr to handle mixed space/tab properly. Issue 5120, patch by Guilherme Polo.
| author | Kurt B. Kaiser <kbk@shore.net> |
|---|---|
| date | Mon, 30 Mar 2009 16:22:00 +0000 |
| parents | 39e9a20b7d7f |
| children | 2d09bcf70395 |
line wrap: on
line diff
--- a/Lib/idlelib/EditorWindow.py Mon Mar 30 16:01:51 2009 +0000 +++ b/Lib/idlelib/EditorWindow.py Mon Mar 30 16:22:00 2009 +0000 @@ -105,10 +105,18 @@ 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()
