~profzoom/ubuntu/quantal/wmaker/bug-1079925

« back to all changes in this revision

Viewing changes to WINGs/Tests/testmywidget.c

  • Committer: Bazaar Package Importer
  • Author(s): Marcelo E. Magallon
  • Date: 2004-11-10 14:05:30 UTC
  • Revision ID: james.westby@ubuntu.com-20041110140530-qpd66b5lm38x7apk
Tags: upstream-0.91.0
ImportĀ upstreamĀ versionĀ 0.91.0

Show diffs side-by-side

added added

removed removed

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