Turning Coordinate Grid/Axes on without using system icons

James Factor shared this question 8 years ago
Answered

How would you define a checkbox, button, or ? so that the Coordinate Grid and Axes in the Graphics window could be turned on or off without having to use the system iconse6cdf1c7867fff74fbc9754312cc380c?


Thanks,


Jim

Comments (2)

photo
1

Hi,

    g=ggbApplet;

    a=g.getValue('a')==1;

    g.setGridVisible(a);

    g.setAxesVisible(a,a);

    g.refreshViews();

Cheers.

Michel

https://ggbm.at/562529

photo
1

Alternatively with ggbscript


If your checkbox is b, set the Update script to be ShowGrid


If using a button create the boolean b=true and the OnClick script to be

    ShowGrid

    SetCaption[button1,If[b,"Hide Grid","Show Grid"]]

    SetValue[b,¬b]

Similarly for ShowAxes[]


Simon

© 2022 International GeoGebra Institute