Script to change the visibility of a List?

post@engdahldata.dk shared this question 3 weeks ago
Answered

How can I write a script to change the visibility of a List?


I found out!


But I also want it to be an open dropdown list.


How can I do that with a geogebra script?

Comments (11)

photo
1

You have to define the as a dropdown list first in the settings of the list. Then you can use the command SetVisibleInView( <List>, <View Number 1|2>, <Boolean> ) in which 1or 2 stands for Graphics 1 or two and true/false manages the visibility.

chris

photo
1

In my script I can create the list, and I can set it visible. That is okay.

Byt then it is only visible as a vertical list at Origo. And it is not a vertical Menu as I need.

How do I use "show as a menu"?, and I also want it to be open and ready.

I want to do it all from thesame script.

photo
1

I have made a simple application with a button which when clicked create a list for a drop-down menu in the Grafic view.

I would like the button to make the list a drop-down list, I can use to start an other dialog-list og do other things.

photo
photo
2

create a checkbox and put in "condition to show object" of list

then you can change the checkbox with mouse or a script

photo
1

Thank you. I do not want to use the mouse or an other script to open or see the menu.

It must be delivered ready to use.

photo
photo
1

question in attached

Files: foro.ggb
photo
1

As I just explained to mr ccambre I just want a button to create and draw a normal drop-down menu, ready to use.

photo
photo
1

What'is the difference between normal drop-down menu and drop-down list?

What are the items of your menu?

what is rhe action for each item?

upload a file if possible

photo
1

1. It is the same.

2. One item might be: "Make a new drop-down menu"

3. The action would be to make a new list, drawn a drop-down list; maybe even wide open.

In your application the list seems to be made by a human. Isn't i possible to make a button or a list to do it?

photo
1

I have made this app with an empty list.

I have marked to be drawn in the graphic view, but of course it doesn' show when it is empty.

When I append an entry with "append(l1,"New entry")" it looses the ability to be drawn in the graphic view.

I have to checkmark by hand, an that is not fair. Isn't there a way to put that checkmark with a script?

photo
photo
1

In the attachment one of the many ways to interpret your request.

Perhaps I have found the correct interpretation by chance. Otherwise, you would have to describe the problem more comprehensively and from a view over all.

Note: it is not possible to set the property "dropDownList" in l1 per script (possibly this concerns your last question)

© 2021 International GeoGebra Institute