Draw as a dropdown via Script

Deniz Bilimleri shared this question 1 week ago
Answered

Hello, I think I have spent enough time on searching a solution for activating the "Draw as a dropdown" option of a list through scripting before bothering you.


And I am also wondering whether we can set the position of the list other than the default via scripting?


Thanks in advance.

Comments (4)

photo
2

The second question is clear: SetValue(list, n) sets the list to its n-th element

In your first sentence I read a lot of frustration although the problem is not hard. First define a list, second select 'draw as a dropdown' to see it shown in the Graphic. (See file added)

chris

photo
1

Thank you Chris. I was trying to set the "Draw as a dropdown" through command/script because I thought everything can be created from scratch. As far as I understand from mathmagic's explanation, there is no explicit command to draw a list as a dropdown to the graphic.


I will create an unvisible list (when empty it is still invisible even though "draw as a dropdown" option is selected) in the template and play with it in the script.

photo
photo
2

hace tiempo, no mucho, no había tanto comando set... en GG y no había tanto problema para hacer un script

simplemente creabamos dos elementos con distintas propiedades y haciamos que fuese visible el que queríamos mostrar.

si necesitas un setdropdown simplemente crea una lista dropdown y en el script selecciona setvisible(list,false) ¿qué importa si la lista tiene o no cierta propiedad si no es visible? al igual que no importa el color de un punto que no se ve.

si necesitas dos visualizaciones de la misma lista entonces crea dos listas que se vean de diferente modo y selecciona la que se ve con una variable booleana. en el script cambia el valor del booleano y todo listo

photo
1

:) Thank you. As a beginner, I thought it is possible to create everything from scratch using commands.


I will stick to your suggestion. I will create a list in a template and work with it in the script.

photo
© 2019 International GeoGebra Institute