Rune - Runtime environment work - mostly threads and locks
[rune.git] / tests / gfxinput2.d
1 #!/usr/local/bin/rune
2 #
3 #       Graphical test
4
5 import "sys" as self;
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
15 subclass gadgets.InputFrame as MyInput {
16         refine public method
17         void
18         inputExecute(const char *text)
19         {
20                 stdout->show("ENTER!", text);
21         }
22 }
23
24 typedef int myint_t = -44;
25
26 int
27 main(int ac, char **av)
28 {
29         Frame *frame;
30         Frame *frame1;
31         MyInput *input;
32         int i;
33         int j;
34         myint_t x;
35
36         frame.createFrame("BODY", &gfx.root, 0, 0, BODY);
37         frame->setBGColor(255, 129, 0);
38         for (i = 0; i < 15; ++i) {
39                 stdio.stdout->fd.write("X", 1);
40                 frame1.createFrame("LEFT", frame, 0, 0, LEFT);
41                 for (j = 0; j < 60; ++j) {
42                         input.createInput(frame1, 0, 0, ABOVE, "Input:");
43                         input->setBlinking(1);
44                 }
45         }
46         frame->recalc();
47         frame->flush();
48         Thread.waitThreads();           # wait until all threads have exited
49         return(0);
50 }