*** empty log message ***

This commit is contained in:
Joe Shochet 2001-10-25 00:30:26 +00:00
parent 42d393ad94
commit 21b73c4ced
3 changed files with 17 additions and 15 deletions

View File

@ -23,6 +23,7 @@ class StateData(DirectObject):
def cleanup(self):
"""cleanup(self)
"""
print "state data cleanup!!!"
self.unload()
return None

View File

@ -958,3 +958,12 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
def taskName(self, idString):
return (idString + "-" + str(self.guiId))
def setProp(self, propString, value):
"""
Allows you to set a property like frame['text'] = 'Joe' in
a function instead of an assignment.
This is useful for setting properties inside function intervals
where must input a function and extraArgs, not an assignment.
"""
self[propString] = value

View File

@ -2,7 +2,7 @@ from DirectFrame import *
"""
import DirectWaitBar
d = DirectWaitBar.DirectWaitBar()
d = DirectWaitBar(borderWidth=(0,0))
"""
@ -20,15 +20,14 @@ class DirectWaitBar(DirectFrame):
optiondefs = (
# Define type of DirectGuiWidget
('pgFunc', PGWaitBar, None),
('width', 1.0, self.setup),
('height', 0.2, self.setup),
('range', 100, self.setup),
('frameSize', (-1,1,-0.1,0.1), None),
('range', 100, self.setRange),
('value', 50, self.setValue),
('barBorderWidth', (0,0), self.setBarBorderWidth),
('barColor', (1,0,0,1), self.setBarColor),
('barColor', (1,0,0,1), self.setBarColor),
('barRelief', FLAT, self.setBarRelief),
)
self.barStyle = PGFrameStyle()
# Merge keyword options with default options
@ -40,13 +39,10 @@ class DirectWaitBar(DirectFrame):
# Call option initialization functions
self.initialiseoptions(DirectWaitBar)
self.setup()
self.updateBarStyle()
def setup(self):
print self['width'], self['height'], self['range']
self.guiItem.setup(self['width'], self['height'], self['range'])
def setRange(self):
self.guiItem.setRange(self['range'])
def setValue(self):
self.guiItem.setValue(self['value'])
@ -56,21 +52,17 @@ class DirectWaitBar(DirectFrame):
def updateBarStyle(self):
if not self.fInit:
print 'updateing'
self.guiItem.setBarStyle(self.barStyle)
def setBarRelief(self):
print 1
self.barStyle.setType(self['barRelief'])
self.updateBarStyle()
def setBarBorderWidth(self):
print 2
self.barStyle.setWidth(*self['barBorderWidth'])
self.updateBarStyle()
def setBarColor(self):
print 3
self.barStyle.setColor(*self['barColor'])
self.updateBarStyle()