Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bloom-beacon!oberon!cit-vax!ucla-cs!zen!ucbvax!shark.gwd.tek.COM!paulsh From: paulsh@shark.gwd.tek.COM Newsgroups: comp.windows.x Subject: Re: Hello World for X.11 Message-ID: <8711181830.AA26000@shark.GWD.TEK.COM> Date: Wed, 18-Nov-87 13:28:53 EST Article-I.D.: shark.8711181830.AA26000 Posted: Wed Nov 18 13:28:53 1987 Date-Received: Sat, 21-Nov-87 12:10:50 EST References: <8711040220.AA04402@devnull.sun.com> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 104 David, Thanks for the Hello World for X.11 programs. They have proved to be useful templates. I am submiting the following corrections that I discovered when using the programs. I'll post them to xpert to avoid duplicate bug reports. 1) The version of make I am using failed due to the tabs at the beginning of the macro definition lines. Thus I removed the tabs on those lines in the Imakefile. 2) The Xlib routine XChangeWindowAttributes() requires a pointer to a XSetWindowAttributes structure and not a pointer to a XWindowAttributes structure. Thus I declared a new variable XSetWindowAttributes xswa; and used it in the assignments and the call to XChangeWindowAttributes(). Patches for these two fixes are given below. Thanks again for the programs. Paul Shearer M.S. 61-277 Tektronix, Inc. P.O. Box 1000 Wilsonville, OR 97070-1000 W (503) 685-2137 tektronix!shark!paulsh -------------------- *** /tmp/,RCSt1025182 Wed Nov 18 10:09:33 1987 --- Imakefile Wed Nov 18 10:09:51 1987 *************** *** 1,11 ! SRCS1 = xhw0.c ! SRCS2 = xhw1.c ! SRCS3 = xhw3.c ! SRCS4 = hw.c ! OBJS1 = xhw0.o ! OBJS2 = xhw1.o ! OBJS3 = xhw3.o ! OBJS4 = hw.o SingleProgramTarget(xhw0, $(OBJS1), $(XLIB), ) --- 1,11 ----- ! SRCS1 = xhw0.c ! SRCS2 = xhw1.c ! SRCS3 = xhw3.c ! SRCS4 = hw.c ! OBJS1 = xhw0.o ! OBJS2 = xhw1.o ! OBJS3 = xhw3.o ! OBJS4 = hw.o SingleProgramTarget(xhw0, $(OBJS1), $(XLIB), ) *** /tmp/,RCSt1010641 Tue Nov 17 18:26:40 1987 --- xhw0.c Tue Nov 17 18:26:14 1987 *************** *** 37,42 XEvent event; /* Event received */ XSizeHints xsh; /* Size hints for window manager */ char *geomSpec; /* Window geometry string */ XWindowAttributes xwa; /* Temporary Window Attribute struct */ /* --- 37,43 ----- XEvent event; /* Event received */ XSizeHints xsh; /* Size hints for window manager */ char *geomSpec; /* Window geometry string */ + XSetWindowAttributes xswa; /* Set Window Attribute struct */ XWindowAttributes xwa; /* Temporary Window Attribute struct */ /* *************** *** 105,113 * use for the window. See Section 3.2.9. Also, set the window's Bit * Gravity to reduce Expose events. */ ! xwa.colormap = DefaultColormap(dpy, DefaultScreen(dpy)); ! xwa.bit_gravity = CenterGravity; ! XChangeWindowAttributes(dpy, win, (CWColormap | CWBitGravity), &xwa); /* * Create the GC for writing the text. See Section 5.3. --- 106,114 ----- * use for the window. See Section 3.2.9. Also, set the window's Bit * Gravity to reduce Expose events. */ ! xswa.colormap = DefaultColormap(dpy, DefaultScreen(dpy)); ! xswa.bit_gravity = CenterGravity; ! XChangeWindowAttributes(dpy, win, (CWColormap | CWBitGravity), &xswa); /* * Create the GC for writing the text. See Section 5.3.