[Idle-dev] CVS: idle EditorWindow.py,1.18,1.19

Stephen M. Gava elguavas@users.sourceforge.net
Mon, 11 Mar 2002 16:21:58 -0800


Update of /cvsroot/idlefork/idle
In directory usw-pr-cvs1:/tmp/cvs-serv16676

Modified Files:
	EditorWindow.py 
Log Message:
further work on dynamic config changes;
editor font


Index: EditorWindow.py
===================================================================
RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** EditorWindow.py	2 Mar 2002 07:16:21 -0000	1.18
--- EditorWindow.py	12 Mar 2002 00:21:56 -0000	1.19
***************
*** 160,165 ****
  
          text['yscrollcommand'] = vbar.set
          text.config(font=(idleConf.GetOption('main','EditorWindow','font'),
!                 idleConf.GetOption('main','EditorWindow','font-size')))
          text_frame.pack(side=LEFT, fill=BOTH, expand=1)
          text.pack(side=TOP, fill=BOTH, expand=1)
--- 160,169 ----
  
          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'),
!                 fontWeight))
          text_frame.pack(side=LEFT, fill=BOTH, expand=1)
          text.pack(side=TOP, fill=BOTH, expand=1)
***************
*** 478,481 ****
--- 482,495 ----
              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):