Fixing windows-specific code

This commit is contained in:
Josh Yelon 2005-06-09 18:48:17 +00:00
parent 0a61e91bbd
commit c7cc6840db
2 changed files with 8 additions and 6 deletions

View File

@ -6,8 +6,7 @@ from direct.showbase.PandaObject import *
from direct.showbase.TkGlobal import * from direct.showbase.TkGlobal import *
from Valuator import * from Valuator import *
from direct.task import Task from direct.task import Task
import math import math,sys,string
import string
FLOATER_WIDTH = 22 FLOATER_WIDTH = 22
FLOATER_HEIGHT = 18 FLOATER_HEIGHT = 18
@ -46,13 +45,15 @@ class FloaterWidget(Pmw.MegaWidget):
def __init__(self, parent = None, **kw): def __init__(self, parent = None, **kw):
#define the megawidget options #define the megawidget options
INITOPT = Pmw.INITOPT INITOPT = Pmw.INITOPT
SystemButtonFace = 'Grey'
if (sys.platform == "win32"): SystemButtonFace='SystemButtonFace'
optiondefs = ( optiondefs = (
# Appearance # Appearance
('width', FLOATER_WIDTH, INITOPT), ('width', FLOATER_WIDTH, INITOPT),
('height', FLOATER_HEIGHT, INITOPT), ('height', FLOATER_HEIGHT, INITOPT),
('relief', RAISED, self.setRelief), ('relief', RAISED, self.setRelief),
('borderwidth', 2, self.setBorderwidth), ('borderwidth', 2, self.setBorderwidth),
('background', 'SystemButtonFace', self.setBackground), ('background', SystemButtonFace, self.setBackground),
# Behavior # Behavior
# Initial value of floater, use self.set to change value # Initial value of floater, use self.set to change value
('value', 0.0, INITOPT), ('value', 0.0, INITOPT),

View File

@ -5,8 +5,7 @@ Slider Class: Velocity style controller for floating point values with
from direct.showbase.TkGlobal import * from direct.showbase.TkGlobal import *
from Valuator import * from Valuator import *
from direct.task import Task from direct.task import Task
import math import math,sys,string
import string
import operator import operator
from pandac.PandaModules import ClockObject from pandac.PandaModules import ClockObject
@ -84,12 +83,14 @@ class SliderWidget(Pmw.MegaWidget):
# Define the megawidget options. # Define the megawidget options.
INITOPT = Pmw.INITOPT INITOPT = Pmw.INITOPT
SystemButtonFace = 'Grey'
if (sys.platform == "win32"): SystemButtonFace='SystemButtonFace'
optiondefs = ( optiondefs = (
# Appearance # Appearance
('style', VALUATOR_MINI, INITOPT), ('style', VALUATOR_MINI, INITOPT),
('relief', RAISED, self.setRelief), ('relief', RAISED, self.setRelief),
('borderwidth', 2, self.setBorderwidth), ('borderwidth', 2, self.setBorderwidth),
('background', 'SystemButtonFace', self.setBackground), ('background', SystemButtonFace, self.setBackground),
('fliparrow', 0, INITOPT), ('fliparrow', 0, INITOPT),
# Behavior # Behavior
# Bounds # Bounds