RosettaCodeData/Task/Simple-windowed-application/Yorick/simple-windowed-application.yorick
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

22 lines
618 B
Text

#include "button.i"
window, 0;
btn_click = Button(text="click me", x=.395, y=.65, dx=0.04368, dy=0.0091);
btn_quit = Button(text="quit", x=.395, y=.6, dx=0.02184, dy=0.0091);
count = 0;
msg = "There have been no clicks yet";
finished = 0;
do {
fma;
plt, msg, .395, .7, justify="CH";
button_plot, btn_click;
button_plot, btn_quit;
xy = mouse(0, 0, "");
if(button_test(btn_click, xy(1), xy(2))) {
count++;
msg = swrite(format="Number of clicks: %d", count);
} else if(button_test(btn_quit, xy(1), xy(2))) {
finished = 1;
winkill, 0;
}
} while(!finished);