[This post might appear twice, if so, I apologize. The first version is
flagged that it has not been accepted yet]
I am controlling a simple animation with a slider, successfully. A mouse
drag updates the parameter correctly but the slider-bar position is not
updated.
If "samp" is a slider, the code
"samp.reset(amp)" generates
"TypeError: reset() takes exactly 1 argument (2 given)".
Here is more detail of the code:
···
=====
samp = Slider(axamp, 'Amp', 0.1, 10.0, valinit=amp)
def update(val):
global amp
amp = samp.val
# samp.reset() # if this is included, a mouse-drag does not change
value of amp. No error.
# samp.reset(amp) # if this is included, a mouse-drag changes value of
amp, but the
# slider-bar-position is not updated. The animation
continues to run in both cases.
# AND GET ERROR:
***********
File "SAS_asl.py", line 28, in update
samp.reset(amp) #
TypeError: reset() takes exactly 1 argument (2 given)
***********
# If there is no call to reset in “update” and the following function is
included:
def reset(event):
samp.reset() # amp is changed, slider-bar-position is not updated
and NO ERROR IS GENERATED
samp.on_changed(update) # always present!
This appears to be a bug. If not, what is wrong with the code?
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Possible-bug-in-slider-reset-tp44638.html
Sent from the matplotlib - users mailing list archive at Nabble.com.