From: Bruce S. <Bru...@nc...> - 2009-09-13 15:04:06
|
I haven't yet figured out why, but the problem arises only if you set "value" in the slider constructor. Remove it from the constructor, and then after creating the slider execute this: s1.value = 0.5 Bruce Sherwood Lenore Horner wrote: > I was being stupid and thought I could pull some of the color-sliders > tricks into the regular controls package and have them for everything > instead of having to copy and paste revised definitions all the time. > After all, I could always re-install the controls.py and controls.pyc > files if I mangled them irrepairably. Maybe not. > > I opened the package and just copied those to files back to the visual > folder in site packages - replacing my mangled ones. No dice. > > I've wiped out Vpython and MacPython and reinstalled both. Still no > good. Controls complains about a property not existing that I can > plainly see in the code is defined. > > Any suggestions for where the wrong definition continues to lurk? > > Here's the error message. > > s1 = slider(pos=(-50,0,0), width=2, length=10, min=0, max=pi/4, > value = 0.5, action=lambda: setangle(s1)) > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/visual/controls.py", line 245, in __init__ > ctrl.__init__(self, args) > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/visual/controls.py", line 85, in __init__ > self.value = args['value'] > File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/visual/controls.py", line 283, in setvalue > self.update(self.pos+self.axis*val*self.length/(self.max-self.min)) > AttributeError: 'slider' object has no attribute 'axis' > > I've tried it both with and without an explicit axis in the slider > call to no avail. > > TIA, > Lenore > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |