mirror of
https://github.com/python/cpython.git
synced 2025-09-05 00:11:10 +00:00
Issue #16511: Use default IDLE width and height if config param is not valid.
Patch Serhiy Storchaka.
This commit is contained in:
parent
1c6c90fc73
commit
d8590ff209
4 changed files with 48 additions and 27 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue