summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/configDialog.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-24 11:15:43 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-24 11:15:43 (GMT)
commit8a495a48a53369120e7ca3b57efe9a07745ea067 (patch)
treeeb0f056072f7b3890c7deaf2237eed1e2f8ea6b4 /Lib/idlelib/configDialog.py
parent159bb53765c895abb701d20881f13468484a9dba (diff)
downloadcpython-8a495a48a53369120e7ca3b57efe9a07745ea067.zip
cpython-8a495a48a53369120e7ca3b57efe9a07745ea067.tar.gz
cpython-8a495a48a53369120e7ca3b57efe9a07745ea067.tar.bz2
Issue #16511: Use default IDLE width and height if config param is not valid.
Patch Serhiy Storchaka.
Diffstat (limited to 'Lib/idlelib/configDialog.py')
-rw-r--r--Lib/idlelib/configDialog.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py
index 434114e..1f4a3a5 100644
--- a/Lib/idlelib/configDialog.py
+++ b/Lib/idlelib/configDialog.py
@@ -925,7 +925,7 @@ class ConfigDialog(Toplevel):
for font in fonts:
self.listFontName.insert(END,font)
configuredFont=idleConf.GetOption('main','EditorWindow','font',
- default='courier')
+ default='courier')
lc_configuredFont = configuredFont.lower()
self.fontName.set(lc_configuredFont)
lc_fonts = [s.lower() for s in fonts]
@@ -935,13 +935,13 @@ class ConfigDialog(Toplevel):
self.listFontName.select_set(currentFontIndex)
self.listFontName.select_anchor(currentFontIndex)
##font size dropdown
- fontSize=idleConf.GetOption('main','EditorWindow','font-size',
- default='10')
+ fontSize=idleConf.GetOption('main', 'EditorWindow', 'font-size',
+ type='int', default='10')
self.optMenuFontSize.SetMenu(('7','8','9','10','11','12','13','14',
- '16','18','20','22'),fontSize )
+ '16','18','20','22'), fontSize )
##fontWeight
self.fontBold.set(idleConf.GetOption('main','EditorWindow',
- 'font-bold',default=0,type='bool'))
+ 'font-bold',default=0,type='bool'))
##font sample
self.SetFontSample()
@@ -1022,10 +1022,13 @@ class ConfigDialog(Toplevel):
self.autoSave.set(idleConf.GetOption('main', 'General', 'autosave',
default=0, type='bool'))
#initial window size
- self.winWidth.set(idleConf.GetOption('main','EditorWindow','width'))
- self.winHeight.set(idleConf.GetOption('main','EditorWindow','height'))
+ self.winWidth.set(idleConf.GetOption('main','EditorWindow','width',
+ type='int'))
+ self.winHeight.set(idleConf.GetOption('main','EditorWindow','height',
+ type='int'))
#initial paragraph reformat size
- self.paraWidth.set(idleConf.GetOption('main','FormatParagraph','paragraph'))
+ self.paraWidth.set(idleConf.GetOption('main','FormatParagraph','paragraph',
+ type='int'))
# default source encoding
self.encoding.set(idleConf.GetOption('main', 'EditorWindow',
'encoding', default='none'))