Change to the linux kernel coding style
[wmaker-crm.git] / WINGs / Tests / testmywidget.c
1
2 #include <WINGs/WINGs.h>
3 #include <stdlib.h>
4
5 #include "mywidget.h"
6
7 void wAbort()
8 {
9         exit(1);
10 }
11
12 int main(int argc, char **argv)
13 {
14         Display *dpy = XOpenDisplay("");
15         WMScreen *scr;
16         WMWindow *win;
17         MyWidget *thing;
18
19         WMInitializeApplication("Test", &argc, argv);
20
21         if (!dpy) {
22                 wfatal("could not open display");
23                 exit(1);
24         }
25
26         scr = WMCreateSimpleApplicationScreen(dpy);
27
28         /* init our widget */
29         InitMyWidget(scr);
30
31         win = WMCreateWindow(scr, "test");
32         WMResizeWidget(win, 150, 50);
33
34         thing = CreateMyWidget(win);
35         SetMyWidgetText(thing, "The Test");
36         WMResizeWidget(thing, 100, 20);
37         WMMoveWidget(thing, 10, 10);
38
39         WMRealizeWidget(win);
40         WMMapSubwidgets(win);
41         WMMapWidget(win);
42
43         WMScreenMainLoop(scr);
44
45         return 0;
46 }