The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Help with dynamic functionality
Replies: 2   Last Post: Dec 3, 2012 3:19 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 4
Registered: 7/4/12
Help with dynamic functionality
Posted: Nov 28, 2012 3:16 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

My actual problem is quite involved but I am including a simple example for
illustrative purposes. I am trying to reproduce "Enabled"-like functionality as follows:

Clear[y, SliderModule];
SetAttributes[SliderModule, HoldAll];
SliderModule[enabled_] :=
DynamicModule[{x = 0}, {Slider[
Dynamic[x, (x = If[enabled, #, 0]) &]], Dynamic[x]}]
{Checkbox[Dynamic[y]], Dynamic[y], SliderModule[y]}

Ideally when the checkbox is checked then the user is able to move the slider; but when it is unchecked the slider resets to zero. The problem is when I uncheck the checkbox the slider doesn't reset to zero until I click on the slider itself. Is there a way to get the slider to immediately reset when I uncheck the checkbox? Please remember that this is a simplification of my actual problem so try to keep the SliderModule structure the same.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.