Can i set or get slider's properties with Geogebra Script Or javascript

chen chao shared this question 8 months ago
Answered

Hello,

Is there any api or command which can get or set all properties of slider,for example, max value, Point style size, I can not find command or api to do it, thanks!

Comments (5)

photo
1

There's the command Slider( <Min>, <Max>, <Increment>, <Speed>, <Width>, <Is Angle>, <Horizontal>, <Animating>, <Random> ).

See https://wiki.geogebra.org/e...

chris

photo
1

thank you very much! the slider command can create a new slider, but for a existed slider i want to get or set it's properties, is these any api can do it?

photo
1

You can define some/all parameters as number objects, which you can redefine with the SetValue Command. So e.g. for minimum value you can start with min = 2 and type 'min' in the parameters of the slider instead of a value. The command SetValue(min, 1) will change the minimum value of the slider into 1. And of course instead of putting just one value in a button you could as well use inputboxes for more flexibility.

chris

photo
1

thanks. In fact, I want to write a function to dynamically adjust any existing slider, so i need a api to get or set propertise of the slider

photo
photo
1

puedes definir el deslizador a partir de los valores y no tienes que obtener los valores a partir del deslizador

es como "qué fue primero: el huevo o la gallina?"

© 2020 International GeoGebra Institute