Rune - Content-locking work 1/2
[rune.git] / tests / gfxbutton1.d
1 #!/usr/local/bin/rune -x
2 #
3 #       Graphical test
4
5 limport "sys";
6 import "stdio";
7 import "gfx";
8 import "gadgets";
9
10 alias stdio.File *stdout = stdio.stdout;
11
12 typedef gfx.Event               Event;
13 typedef gfx.Frame               Frame;
14 typedef gadgets.ButtonFrame     Button;
15
16 subclass Button as MyButton {
17         refine public method
18         void
19         buttonExecute()
20         {
21                 stdout->show("BUTTON!", this.text);
22         }
23 }
24
25 int
26 main(int ac, char **av)
27 {
28         Frame *frame;
29         MyButton *button1;
30         MyButton *button2;
31
32         frame.createFrame("BODY", &gfx.root, 128, 128, BODY);
33         frame->setBGColor(255, 129, 0);
34         button1.createButton(frame, -1, -1, ABOVE, "Test1");
35         button2.createButton(frame, -1, -1, ABOVE, "Test2");
36         frame->recalc();
37         Thread.waitThreads();           # wait until all threads have exited
38         return(0);
39 }