how to reset the slider values when a slider value attains 2?

Prasad Ramalingam shared this question 1 year ago
Answered

Please suggest the command

to reset the slider values when a slider value attains 2?

or

how to control a button by using a slider value?

Comments (2)

photo
1

Maybe you are looking for something like in the attachment.

(otherwise explain more details, especially the context)

Note:

to ask a value of a slider (min< value < max) is never exact (can be instabile) because

- the slider can jump over this value

- the time to call the script can be too short

photo
1

Prasad,

The attached file may help, although I'm not exactly sure what you're wanting.

When 'slider' value is 2 the slider resets to 0; see slider Update script line 1.

The 'button' caption is changed based on the slider value; see slider Update script line 2.

The result of clicking the button changes based on the slider value; see the 'button' On Click script.


Note that these scripts could be written different ways also, for example using the Execute[] command, an example is given in the attached as part of the text.

If you want to show or hide a button completely based on a slider value, that is not in the attached file but it's possible, for example by going to Preferences for the button, to the Advanced tab, and setting the Condition to Show Object to include a value or interval for the slider, such as 'slider <=1' where 'slider' is the name of the slider.

Let me know if you I might be able to help further.

© 2020 International GeoGebra Institute