Another template: window with menu / group
Same as above but with a plain menu. It also shows a control to modify the width of the circle on one of the pages.
window(800, 600);
char x, s[9]="world";
int r = 99;
menu(0, "Close", close);
menu(0, "One", do);
menu(0, "Two", do);
menu(0, "Three", do);
group(1); ` 0 is default group, these belong to group 1
button(33, 33, "Hi", NULL);
edit(111, 33, 99, s, NULL);
group(2); ` these belong to group 2
updownx(11, 11, x, dosecond, 0, 60, 10, &r);
label(33, 99, "Hi world");
group(3); ` these belong to group 3
checkbox(33, 33, "x", x, NULL);
menunumber = 1;` ` this is menu One
@do;
run;
:do;
command(GROUP, -1, menunumber, 0); ` activate the group
fill(0, 0, width, height, -2); ` clear screen
switch (menunumber)
{
:1; @dofirst; break;
:2; @dosecond; break;
:3; @dothird; break;
}
return;
:dofirst;
line(0, 0, width, height, RED);
return;
:dosecond;
fill(0, 0, width, height, -2); ` clear screen for new radius
circle(width / 2, height / 2, r, BLUE);
return;
:dothird;
box(0, 0, width, height, PURPLE, 2);
return;
:close;
quit;