[Idle-dev] CVS: idle PyShell.py,1.11,1.12 EditorWindow.py,1.17,1.18
Stephen M. Gava
elguavas@users.sourceforge.net
Fri, 01 Mar 2002 23:16:23 -0800
Update of /cvsroot/idlefork/idle
In directory usw-pr-cvs1:/tmp/cvs-serv7599
Modified Files:
PyShell.py EditorWindow.py
Log Message:
First work on making config changes dynamic,
dynamic theme changes
Index: PyShell.py
===================================================================
RCS file: /cvsroot/idlefork/idle/PyShell.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** PyShell.py 4 Jan 2002 07:53:06 -0000 1.11
--- PyShell.py 2 Mar 2002 07:16:21 -0000 1.12
***************
*** 135,138 ****
--- 135,142 ----
# Colorizer for the shell window itself
+
+ def __init__(self):
+ ColorDelegator.__init__(self)
+ self.LoadTagDefs()
def recolorize_main(self):
***************
*** 140,155 ****
self.tag_add("SYNC", "1.0", "iomark")
ColorDelegator.recolorize_main(self)
!
! tagdefs = ColorDelegator.tagdefs.copy()
! theme = idleConf.GetOption('main','Theme','name')
!
! tagdefs.update({
! "stdin": {'background':None,'foreground':None},
! "stdout": idleConf.GetHighlight(theme, "stdout"),
! "stderr": idleConf.GetHighlight(theme, "stderr"),
! "console": idleConf.GetHighlight(theme, "console"),
! "ERROR": idleConf.GetHighlight(theme, "error"),
! None: idleConf.GetHighlight(theme, "normal"),
! })
class ModifiedUndoDelegator(UndoDelegator):
--- 144,159 ----
self.tag_add("SYNC", "1.0", "iomark")
ColorDelegator.recolorize_main(self)
!
! def LoadTagDefs(self):
! ColorDelegator.LoadTagDefs(self)
! theme = idleConf.GetOption('main','Theme','name')
! self.tagdefs.update({
! "stdin": {'background':None,'foreground':None},
! "stdout": idleConf.GetHighlight(theme, "stdout"),
! "stderr": idleConf.GetHighlight(theme, "stderr"),
! "console": idleConf.GetHighlight(theme, "console"),
! "ERROR": idleConf.GetHighlight(theme, "error"),
! None: idleConf.GetHighlight(theme, "normal"),
! })
class ModifiedUndoDelegator(UndoDelegator):
Index: EditorWindow.py
===================================================================
RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** EditorWindow.py 26 Feb 2002 02:31:03 -0000 1.17
--- EditorWindow.py 2 Mar 2002 07:16:21 -0000 1.18
***************
*** 103,106 ****
--- 103,109 ----
self.menubar = Menu(root)
self.top = top = self.Toplevel(root, menu=self.menubar)
+ #self.top.instanceDict makes flist.inversedict avalable to
+ #configDialog.py so it can access all EditorWindow instaces
+ self.top.instanceDict=flist.inversedict
self.vbar = vbar = Scrollbar(top, name='vbar')
self.text_frame = text_frame = Frame(top)
***************
*** 468,471 ****
--- 471,481 ----
self.color = None
self.per.insertfilter(self.undo)
+
+ def ResetColorizer(self):
+ #this function is called from configDialog.py
+ #to update the colour theme if it is changed
+ if self.color:
+ self.color = self.ColorDelegator()
+ self.per.insertfilter(self.color)
def saved_change_hook(self):