Duplicate needed as a command and missing set/get script functions added

johnbmaths shared this idea 2 years ago
Declined

I would like to automate creation of Input boxes from GGB Script or better JS. Unfortunately the length of the Input boxes are set at a default of 20 where 4/5 is more suitable for my current needs.

There is currently no get/set for Input box lengths so scripts out of the question. The obvious alternative is to manually create a suitable Input box and copy and place it where needed from script. I find that there is no means of doing this.

The Duplicate command/utility is not available via script or indeed as a command. CopyFreeObject would be perfect but it doesn’t keep the settings of the original object it copies so if used with an InputBox you get the length set to 20 whatever original length was set, so back to square one.

I really would like to see a Duplicate command in GGB and also the missing get/set properties for such as InputBox and a few others added.

The documentation describes InputBox as “perhaps the most important object in GGB …”. As such, it’s properties should be available to change easily in script.

Comments (4)

photo
1

Can you create them in advance then use https://wiki.geogebra.org/e... ?

photo
1

Yes if you know in advance whether you want 4 or 12.

photo
photo
1

in JS you can use: https://wiki.geogebra.org/e...

photo
1

A better option would be to have the requested items rather than adhoc hacks every time something as simple as Duplicate is needed.

photo
© 2023 International GeoGebra Institute