From b77d343bc846c2049a4cffb1dfd65eb49d1728b4 Mon Sep 17 00:00:00 2001 From: "Steven M. Gava" Date: Sat, 2 Mar 2002 07:16:21 +0000 Subject: First work on making config changes dynamic, dynamic theme changes --- Lib/idlelib/PyShell.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'Lib/idlelib/PyShell.py') diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 9333ea91f96..fa4bb3d87f1 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -134,23 +134,27 @@ class PyShellFileList(FileList): class ModifiedColorDelegator(ColorDelegator): # Colorizer for the shell window itself + + def __init__(self): + ColorDelegator.__init__(self) + self.LoadTagDefs() def recolorize_main(self): self.tag_remove("TODO", "1.0", "iomark") 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"), - }) + + 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): -- cgit v1.2.3