Is there any way to get the applet size by code?

Javier Cayetano Rodríguez shared this question 3 years ago

In order to insert an applet on a web using the API, it is mandatory to inlude its dimensions (height and width)

Would it be possible to use the applet default dimensions? (to show the applet of the same size as it is uploaded on geogebra)

or at least obtain those values by code ( I mean, a command like "getWidth" or "getHeight"). [I know I can manually get them by clicking on the properties]

It would be very useful if I want to insert an applet just by knowing its address.

Thank you.

Best Answer

Comments (3)


Thank you very much!

Very interesting. I think it will do


Edited: I see that my suggestion doesn't answer the question.

Original answer:


For a command like "getWidth" or "getHeight", try with Corner(5) (on GeoGebra environment):

SetValue(getWidth, x(Corner(5))

SetValue(getHeight, y(Corner(5))

So, you get the current size of the applet in pixels.

More about Corner command:

© 2022 International GeoGebra Institute