From: Seth M. <sm...@ps...> - 2011-06-09 21:50:08
|
Hello all, I may have found a bug in the slider object regarding setting self.value with __init__. When you declare a slider the slider first runs ctrl.__init__, since it is a subclass of the ctrl object. Inside of ctrl.__init__, if "value" is one of the arguments, it puts the value of "value" into self.value, which is defined with the property function of the slider as the method slider.setvalue. In slider.setvalue, it wants to access self.axis, but self.axis is not defined until after ctrl.__init__. This results as an AttributeError. A workaround is to define value after running __init__ on the slider, but this is a bug that might want to be looked at. As a side note, regarding the slider object, I have a feature request. It would be nice if there could be a label on the slider like for a button, so that the current value of the slider is displayed on the handle. This is the case on the custom sliders in the colorsliders.py example for vpython. Additionally, I notice that these sliders are made of a sphere and cylinder, not of boxes. It might be nice for the user to be able to choose the shape of the slider, either boxes or smooth. Seth Morton |