From a57283816fcbb255d42772230bccaf9875eea69f Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Thu, 29 Aug 2002 23:36:56 +0000 Subject: [PATCH] frameColor can be a list of colors --- direct/src/gui/DirectGuiBase.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/direct/src/gui/DirectGuiBase.py b/direct/src/gui/DirectGuiBase.py index 846d7efdb6..50ce454696 100644 --- a/direct/src/gui/DirectGuiBase.py +++ b/direct/src/gui/DirectGuiBase.py @@ -942,8 +942,16 @@ class DirectGuiWidget(DirectGuiBase, NodePath): self.updateFrameStyle() 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']): + if i >= len(colors): + color = colors[-1] + else: + color = colors[i] self.frameStyle[i].setColor(color[0], color[1], color[2], color[3]) self.updateFrameStyle()