diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-24 11:17:59 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-24 11:17:59 (GMT) |
commit | d8590ff209369f45a5ed417c79ce255a33f70a1d (patch) | |
tree | 4f12c22f6c91af77bef89b530d3890a30151b6f5 /Lib/idlelib/EditorWindow.py | |
parent | 1c6c90fc73bc779da80982aaf0c17644c6017fa5 (diff) | |
download | cpython-d8590ff209369f45a5ed417c79ce255a33f70a1d.zip cpython-d8590ff209369f45a5ed417c79ce255a33f70a1d.tar.gz cpython-d8590ff209369f45a5ed417c79ce255a33f70a1d.tar.bz2 |
Issue #16511: Use default IDLE width and height if config param is not valid.
Patch Serhiy Storchaka.
Diffstat (limited to 'Lib/idlelib/EditorWindow.py')
-rw-r--r-- | Lib/idlelib/EditorWindow.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 241bd38..efd3c54 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -172,13 +172,13 @@ class EditorWindow(object): 'recent-files.lst') self.text_frame = text_frame = Frame(top) self.vbar = vbar = Scrollbar(text_frame, name='vbar') - self.width = idleConf.GetOption('main','EditorWindow','width') + self.width = idleConf.GetOption('main','EditorWindow','width', type='int') text_options = { 'name': 'text', 'padx': 5, 'wrap': 'none', 'width': self.width, - 'height': idleConf.GetOption('main', 'EditorWindow', 'height')} + 'height': idleConf.GetOption('main', 'EditorWindow', 'height', type='int')} 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 @@ -255,7 +255,8 @@ class EditorWindow(object): if idleConf.GetOption('main', 'EditorWindow', 'font-bold', type='bool'): fontWeight='bold' text.config(font=(idleConf.GetOption('main', 'EditorWindow', 'font'), - idleConf.GetOption('main', 'EditorWindow', 'font-size'), + idleConf.GetOption('main', 'EditorWindow', + 'font-size', type='int'), fontWeight)) text_frame.pack(side=LEFT, fill=BOTH, expand=1) text.pack(side=TOP, fill=BOTH, expand=1) @@ -763,7 +764,8 @@ class EditorWindow(object): if idleConf.GetOption('main','EditorWindow','font-bold',type='bool'): fontWeight='bold' self.text.config(font=(idleConf.GetOption('main','EditorWindow','font'), - idleConf.GetOption('main','EditorWindow','font-size'), + idleConf.GetOption('main','EditorWindow','font-size', + type='int'), fontWeight)) def RemoveKeybindings(self): |