Add a highlight theme for builtin keywords. Python Patch 805830 Nigel Rowe
M ClassBrowser.py
M ColorDelegator.py
M EditorWindow.py
M NEWS.txt
M PyShell.py
M TreeWidget.py
M config-highlight.def
M configDialog.py
M configHandler.py
diff --git a/Lib/idlelib/TreeWidget.py b/Lib/idlelib/TreeWidget.py
index 1c9eb2e..c5c171f 100644
--- a/Lib/idlelib/TreeWidget.py
+++ b/Lib/idlelib/TreeWidget.py
@@ -20,6 +20,7 @@
import imp
import ZoomHeight
+from configHandler import idleConf
ICONDIR = "Icons"
@@ -249,10 +250,11 @@
except AttributeError:
# padding carefully selected (on Windows) to match Entry widget:
self.label = Label(self.canvas, text=text, bd=0, padx=2, pady=2)
+ theme = idleConf.GetOption('main','Theme','name')
if self.selected:
- self.label.configure(fg="white", bg="darkblue")
+ self.label.configure(idleConf.GetHighlight(theme, 'hilite'))
else:
- self.label.configure(fg="black", bg="white")
+ self.label.configure(idleConf.GetHighlight(theme, 'normal'))
id = self.canvas.create_window(textx, texty,
anchor="nw", window=self.label)
self.label.bind("<1>", self.select_or_edit)