[5478] in Athena Bugs
vax 6.4R: Xlib
daemon@ATHENA.MIT.EDU (janson@ATHENA.MIT.EDU)
Tue Jul 10 21:56:09 1990
From: janson@ATHENA.MIT.EDU
To: bugs@ATHENA.MIT.EDU
Date: Tue, 10 Jul 90 11:18:14 EDT
System name: scharoun
Type and version: dec station 3400
Display type: monochrome (i don't know the type)
What were you trying to do?
use Xlib utilities to create cursors from pixmaps.
(see below)
What's wrong:
the routine XCrCursor failed with an unaligned access error.
a dbx stack trace shows five arguments rather than the seven specified
by the various manuals.
What should have happened:
the same code runs on both RT and Vax workstations.
Please describe any relevant documentation references:
none. (but see below.)
------------------cut ----------------------------------
# include <stdio.h>
# include <X11/Xos.h>
# include <X11/Xlib.h>
# include <X11/Xutil.h>
# include "smcur_gc0.c"
# include "smcur_gcm.c"
main(argc,argv)
int argc;
char* argv;
{
Pixmap cursorSource;
Pixmap cursorMask;
Cursor SMGCCursors[4];
Display* SMdisplay;
Window SMrootWindow;
int SMscreen;
char* displayName;
displayName =(char*) getenv("DISPLAY");
if ((SMdisplay = XOpenDisplay(displayName)) == NULL) {
fprintf(stderr,"\n%s: can't open display[%s].\n",
argv[0],
(displayName == NULL ? "[default]" : displayName));
return( -1 );
}
(void) XSynchronize(SMdisplay, True);
SMscreen = XDefaultScreen(SMdisplay);
SMrootWindow = XDefaultRootWindow(SMdisplay);
cursorMask = XCreateBitmapFromData(SMdisplay,SMrootWindow,
smcur_gcm_bits,
smcur_gcm_width,smcur_gcm_height);
cursorSource = XCreateBitmapFromData(SMdisplay,SMrootWindow,
smcur_gc0_bits,
smcur_gc0_width,smcur_gc0_height);
SMGCCursors[0] =
XCreatePixmapCursor(SMdisplay,cursorSource,cursorMask,
XWhitePixel(SMdisplay,SMscreen),
XBlackPixel(SMdisplay,SMscreen),
smcur_gc0_x_hot,smcur_gc0_y_hot);
/* according to the debugger, it fails in the previous call */
XFlush(SMdisplay);
exit(0);
}
----------------------cut -----------------------------------------
ps: this is being send from a vax because send does not work on my
decstation...?
james anderson.