Files
wmaker/WINGs/Tests/testmywidget.c
T

47 lines
723 B
C
Raw Normal View History

1998-09-29 22:36:29 +00:00
#include <WINGs/WINGs.h>
#include <stdlib.h>
1998-09-29 22:36:29 +00:00
#include "mywidget.h"
2009-08-20 00:59:40 +02:00
void wAbort()
1998-09-29 22:36:29 +00:00
{
2009-08-20 00:59:40 +02:00
exit(1);
1998-09-29 22:36:29 +00:00
}
int main(int argc, char **argv)
{
2009-08-20 00:59:40 +02:00
Display *dpy = XOpenDisplay("");
WMScreen *scr;
WMWindow *win;
MyWidget *thing;
1998-09-29 22:36:29 +00:00
2009-08-20 00:59:40 +02:00
WMInitializeApplication("Test", &argc, argv);
1998-09-29 22:36:29 +00:00
2009-08-20 00:59:40 +02:00
if (!dpy) {
wfatal("could not open display");
exit(1);
}
2004-10-12 21:28:27 +00:00
2009-08-20 00:59:40 +02:00
scr = WMCreateSimpleApplicationScreen(dpy);
2004-10-12 21:28:27 +00:00
2009-08-20 00:59:40 +02:00
/* init our widget */
InitMyWidget(scr);
1998-09-29 22:36:29 +00:00
2009-08-20 00:59:40 +02:00
win = WMCreateWindow(scr, "test");
WMResizeWidget(win, 150, 50);
2004-10-12 21:28:27 +00:00
2009-08-20 00:59:40 +02:00
thing = CreateMyWidget(win);
SetMyWidgetText(thing, "The Test");
WMResizeWidget(thing, 100, 20);
WMMoveWidget(thing, 10, 10);
2004-10-12 21:28:27 +00:00
2009-08-20 00:59:40 +02:00
WMRealizeWidget(win);
WMMapSubwidgets(win);
WMMapWidget(win);
2004-10-12 21:28:27 +00:00
2009-08-20 00:59:40 +02:00
WMScreenMainLoop(scr);
2004-10-12 21:28:27 +00:00
2009-08-20 00:59:40 +02:00
return 0;
1998-09-29 22:36:29 +00:00
}