summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven M. Gava <elguavas@python.net>2002-03-12 00:21:56 (GMT)
committerSteven M. Gava <elguavas@python.net>2002-03-12 00:21:56 (GMT)
commitb1585417d1f7ae8984ca72b16fd5a21746949ae5 (patch)
tree922d09382d0723acd2d83bdd338fb346f06f51a3
parent314bae50b967393d1e64f5b42e3cfb2027ff9b32 (diff)
downloadcpython-b1585417d1f7ae8984ca72b16fd5a21746949ae5.zip
cpython-b1585417d1f7ae8984ca72b16fd5a21746949ae5.tar.gz
cpython-b1585417d1f7ae8984ca72b16fd5a21746949ae5.tar.bz2
further work on dynamic config changes;
editor font
-rw-r--r--Lib/idlelib/EditorWindow.py16
-rw-r--r--Lib/idlelib/configDialog.py2
2 files changed, 16 insertions, 2 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index 8a2109d..99f40a7 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -159,8 +159,12 @@ class EditorWindow:
vbar.pack(side=RIGHT, fill=Y)
text['yscrollcommand'] = vbar.set
+ fontWeight='normal'
+ 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'),
+ fontWeight))
text_frame.pack(side=LEFT, fill=BOTH, expand=1)
text.pack(side=TOP, fill=BOTH, expand=1)
text.focus_set()
@@ -478,6 +482,16 @@ class EditorWindow:
self.color = self.ColorDelegator()
self.per.insertfilter(self.color)
+ def ResetFont(self):
+ #this function is called from configDialog.py
+ #to update the text widgets' font if it is changed
+ fontWeight='normal'
+ 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'),
+ fontWeight))
+
def saved_change_hook(self):
short = self.short_title()
long = self.long_title()
diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py
index 4f85cc0..8367fe2 100644
--- a/Lib/idlelib/configDialog.py
+++ b/Lib/idlelib/configDialog.py
@@ -939,7 +939,6 @@ class ConfigDialog(Toplevel):
type='bool',default=1))
##currently set theme
currentOption=idleConf.CurrentTheme()
- print 'current option',currentOption
##load available theme option menus
if self.themeIsBuiltin.get(): #default theme selected
itemList=idleConf.GetSectionList('default','highlight')
@@ -1096,6 +1095,7 @@ class ConfigDialog(Toplevel):
winInstances=self.parent.instanceDict.keys()
for instance in winInstances:
instance.ResetColorizer()
+ instance.ResetFont()
def Cancel(self):
self.destroy()