Browse Source

frameColor can be a list of colors

Darren Ranalli 23 years ago
parent
commit
a57283816f
1 changed files with 9 additions and 1 deletions
  1. 9 1
      direct/src/gui/DirectGuiBase.py

+ 9 - 1
direct/src/gui/DirectGuiBase.py

@@ -942,8 +942,16 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
         self.updateFrameStyle()
         self.updateFrameStyle()
 
 
     def setFrameColor(self):
     def setFrameColor(self):
-        color = self['frameColor']
+        # this might be a single color or a list of colors
+        colors = self['frameColor']
+        if type(colors[0]) == types.IntType or \
+           type(colors[0]) == types.FloatType:
+            colors = (colors,)
         for i in range(self['numStates']):
         for i in range(self['numStates']):
+            if i >= len(colors):
+                color = colors[-1]
+            else:
+                color = colors[i]
             self.frameStyle[i].setColor(color[0], color[1], color[2], color[3])
             self.frameStyle[i].setColor(color[0], color[1], color[2], color[3])
         self.updateFrameStyle()
         self.updateFrameStyle()