home *** CD-ROM | disk | FTP | other *** search
-
- #include "jam.h"
-
-
- main(ac, av)
- int ac;
- char **av;
- {
- Display *dpy = XOpenDisplay(getenv("DISPLAY"));
-
- if (ac != 2)
- {
- printf("Bad args to xnotalrm\n");
- exit (-1);
- }
-
- if (dpy)
- {
- int s_screen = DefaultScreen(dpy);
- unsigned long x_mask = KeyPressMask | KeyReleaseMask;
- Window window = XCreateSimpleWindow(dpy, RootWindow(dpy, s_screen),
- 10, 50, 10 * strlen(av[1]), 10, 0,
- BlackPixel(dpy, s_screen),
- WhitePixel(dpy, s_screen));
- XSelectInput(dpy, window, x_mask);
- XStoreName(dpy, window, av[1]);
- XMapWindow(dpy, window);
- XSync(dpy, 1);
- XBell(dpy, 0);
- XBell(dpy, 0);
- while (1)
- {
- XEvent event;
-
- XNextEvent(dpy, &event);
- if (event.type == ButtonPress || event.type == KeyPress)
- exit(0);
- }
- }
- else
- {
- printf("Can't open display\n");
- exit (-1);
- }
- }