Anonymous user
Simple windowed application: Difference between revisions
no edit summary
No edit summary |
No edit summary |
||
Line 1,706:
End Sub
</lang>
=={{header|Yorick}}==▼
Yorick does not include a GUI toolkit. However, it does provide a plotting system that can emulate some basic GUI features, such as buttons and labels. The above sample uses a built-in library "button.i", which is itself written in Yorick.▼
<lang yorick>#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);</lang>▼
=={{header|Web 68}}==
Line 1,837 ⟶ 1,811:
<b>fdtow68</b>.
</lang>
▲=={{header|Yorick}}==
▲Yorick does not include a GUI toolkit. However, it does provide a plotting system that can emulate some basic GUI features, such as buttons and labels. The above sample uses a built-in library "button.i", which is itself written in Yorick.
▲<lang yorick>#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);</lang>
{{omit from|ACL2}}
{{omit from|AWK}}
|