1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "gui.h"
int main(void)
{
gui *g;
widget *w, *c1, *c2, *l, *plot, *tl;
int tlcol;
g = gui_init();
c1 = new_container(g, VERTICAL);
c2 = new_container(g, HORIZONTAL);
l = new_label(g, "this is a good label");
widget_add_child(g, c2, l, 0);
l = new_label(g, "this is another good label");
widget_add_child(g, c2, l, -1);
l = new_label(g, "OH! WHAT A LABEL!");
widget_add_child(g, c1, l, -1);
widget_add_child(g, c1, c2, 0);
plot = new_xy_plot(g, 100, 100, "xy plot test", 30);
#if 0
c2 = new_container(g, HORIZONTAL);
widget_add_child(g, c2, plot, -1);
widget_add_child(g, c1, c2, -1);
#else
widget_add_child(g, c1, plot, -1);
#endif
tlcol = new_color(g, "#ddf");
tl = new_text_list(g, 300, 10, tlcol);
widget_add_child(g, c1, tl, -1);
text_list_add(g, tl, "hello", -1);
text_list_add(g, tl, "world", -1);
w = new_toplevel_window(g, 500, 400, "test window");
widget_add_child(g, w, c1, 0);
gui_loop(g);
return 0;
}