1 /*
2    window.c
3 
4    Mike Hufnagel & Bill Kendrick
5    Last modified: 11/18/95
6 */
7 
8 #include <X11/Xlib.h>
9 #include <X11/Xutil.h>
10 #include "window.h"
11 
OpenWindow(Display * display,Window parent,int x,int y,int width,int height,unsigned long bordercolor,unsigned long backcolor,unsigned long event_mask,Visual * visual)12 Window OpenWindow(Display *display, Window parent, int x, int y, int width,
13 		  int height, unsigned long bordercolor,
14 		  unsigned long backcolor, unsigned long event_mask,
15 		  Visual *visual)
16 {
17   Window window;
18   XSetWindowAttributes attributes;
19   unsigned long attr_mask;
20 
21   /* set up window attributes first */
22 
23   attributes.event_mask = event_mask;
24   attributes.border_pixel = bordercolor;
25   attributes.background_pixel = backcolor;
26   attr_mask = CWEventMask | CWBackPixel | CWBorderPixel;
27 
28   /* uncomment this to override-redirect: */
29   /*
30     attributes.override_redirect = True;
31     attr_mask = attr_mask | CWOverrideRedirect;
32     */
33 
34   /* create window! */
35   window = XCreateWindow(display,parent,x,y,width,height,BORDER_WIDTH,
36 			 CopyFromParent,InputOutput,visual,attr_mask,
37 			 &attributes);
38 
39   return(window);
40 }
41 
42 
43 
44 
45