Browse Source

Added a feature for chaning label textBG

Gyedo Jeon 16 years ago
parent
commit
385249cfa2
1 changed files with 5 additions and 1 deletions
  1. 5 1
      direct/src/tkwidgets/Tree.py

+ 5 - 1
direct/src/tkwidgets/Tree.py

@@ -386,7 +386,8 @@ class TreeNode:
             self.label.configure(fg="white", bg="red")
         else:
             fg = self.item.GetTextFg()
-            self.label.configure(fg=fg, bg="white")
+            bg = self.item.GetTextBg()
+            self.label.configure(fg=fg, bg=bg)
         id = self.canvas.create_window(textx, texty,
                                        anchor="nw", window=self.label)
         self.label.bind("<1>", self.select_or_edit)
@@ -486,6 +487,9 @@ class TreeItem:
     def GetTextFg(self):
         return "black"
 
+    def GetTextBg(self):
+        return "white"
+
     def GetLabelText(self):
         """Return label text string to display in front of text (if any)."""