From 52e8eb7482207727e80bf0d276c7dd15b99b1881 Mon Sep 17 00:00:00 2001 From: Joe Shochet Date: Fri, 2 Mar 2001 03:45:22 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/gui/Button.py | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/direct/src/gui/Button.py b/direct/src/gui/Button.py index 58a68ea8d9..12bde2fc14 100644 --- a/direct/src/gui/Button.py +++ b/direct/src/gui/Button.py @@ -13,32 +13,32 @@ class Button(DirectObject): self.name = name # if no label given, use the button name if (label == None): - self.label = name + label = self.name + + # check to see if this is an actual guiLabel or just text + if (type(label) == type('')): + # text label, make text button + self.label = label + # up + self.l1 = GuiLabel.GuiLabel.makeSimpleTextLabel(self.label, + font) + self.l1.setForegroundColor(0., 0., 0., 1.) + self.l1.thaw() + # roll-over up + self.l2 = GuiLabel.GuiLabel.makeSimpleTextLabel(self.label, + font) + self.l2.setForegroundColor(0., 0., 0., 1.) + self.l2.setBackgroundColor(1., 1., 0., 1.) + self.l2.thaw() + # roll-over down + self.l3 = GuiLabel.GuiLabel.makeSimpleTextLabel(self.label, + font) + self.l3.setForegroundColor(1., 1., 1., 1.) + self.l3.setBackgroundColor(0., 0., 0., 1.) + self.l3.thaw() else: - # check to see if this is an actual guiLabel or just text - if (type(label) == type('')): - # text label, make text button - self.label = label - # up - self.l1 = GuiLabel.GuiLabel.makeSimpleTextLabel(self.label, - font) - self.l1.setForegroundColor(0., 0., 0., 1.) - self.l1.thaw() - # roll-over up - self.l2 = GuiLabel.GuiLabel.makeSimpleTextLabel(self.label, - font) - self.l2.setForegroundColor(0., 0., 0., 1.) - self.l2.setBackgroundColor(1., 1., 0., 1.) - self.l2.thaw() - # roll-over down - self.l3 = GuiLabel.GuiLabel.makeSimpleTextLabel(self.label, - font) - self.l3.setForegroundColor(1., 1., 1., 1.) - self.l3.setBackgroundColor(0., 0., 0., 1.) - self.l3.thaw() - else: - # label provided, use it for all labels - self.l1 = self.l2 = self.l3 = label + # label provided, use it for all labels + self.l1 = self.l2 = self.l3 = label self.button = GuiButton.GuiButton(self.name, self.l1, self.l2, self.l3, self.l3, self.l1)