From c7cc6840db58538d77e6da78f0475daf4a2b71f1 Mon Sep 17 00:00:00 2001 From: Josh Yelon Date: Thu, 9 Jun 2005 18:48:17 +0000 Subject: [PATCH] Fixing windows-specific code --- direct/src/tkwidgets/Floater.py | 7 ++++--- direct/src/tkwidgets/Slider.py | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/direct/src/tkwidgets/Floater.py b/direct/src/tkwidgets/Floater.py index 21413d3353..41c671973b 100644 --- a/direct/src/tkwidgets/Floater.py +++ b/direct/src/tkwidgets/Floater.py @@ -6,8 +6,7 @@ from direct.showbase.PandaObject import * from direct.showbase.TkGlobal import * from Valuator import * from direct.task import Task -import math -import string +import math,sys,string FLOATER_WIDTH = 22 FLOATER_HEIGHT = 18 @@ -46,13 +45,15 @@ class FloaterWidget(Pmw.MegaWidget): def __init__(self, parent = None, **kw): #define the megawidget options INITOPT = Pmw.INITOPT + SystemButtonFace = 'Grey' + if (sys.platform == "win32"): SystemButtonFace='SystemButtonFace' optiondefs = ( # Appearance ('width', FLOATER_WIDTH, INITOPT), ('height', FLOATER_HEIGHT, INITOPT), ('relief', RAISED, self.setRelief), ('borderwidth', 2, self.setBorderwidth), - ('background', 'SystemButtonFace', self.setBackground), + ('background', SystemButtonFace, self.setBackground), # Behavior # Initial value of floater, use self.set to change value ('value', 0.0, INITOPT), diff --git a/direct/src/tkwidgets/Slider.py b/direct/src/tkwidgets/Slider.py index 0905fe2ac1..37e546349c 100644 --- a/direct/src/tkwidgets/Slider.py +++ b/direct/src/tkwidgets/Slider.py @@ -5,8 +5,7 @@ Slider Class: Velocity style controller for floating point values with from direct.showbase.TkGlobal import * from Valuator import * from direct.task import Task -import math -import string +import math,sys,string import operator from pandac.PandaModules import ClockObject @@ -84,12 +83,14 @@ class SliderWidget(Pmw.MegaWidget): # Define the megawidget options. INITOPT = Pmw.INITOPT + SystemButtonFace = 'Grey' + if (sys.platform == "win32"): SystemButtonFace='SystemButtonFace' optiondefs = ( # Appearance ('style', VALUATOR_MINI, INITOPT), ('relief', RAISED, self.setRelief), ('borderwidth', 2, self.setBorderwidth), - ('background', 'SystemButtonFace', self.setBackground), + ('background', SystemButtonFace, self.setBackground), ('fliparrow', 0, INITOPT), # Behavior # Bounds