Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!dogie.macc.wisc.edu!decwrl!ucbvax!CS.UOREGON.EDU!anderdla From: anderdla@CS.UOREGON.EDU Newsgroups: comp.windows.x Subject: Another question, succinctly stated. Message-ID: <9002262153.AA12153@cacofonix.cs.uoregon.edu> Date: 26 Feb 90 21:53:12 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 39 This time my question is a little easier. Simply stated, XMatchVisualInfo and XGetVisualInfo both give me a segmentation fault when I call them. I have tried allocating space for visualinfo and not allocating, makes no difference. Here's a short listing of applicable code: display=XOpenDisplay(NULL); if (display == NULL) quiterr("can`t open display; DISPLAY variable set?"); screen = DefaultScreen(display); screenp = DefaultScreenOfDisplay(display); depth = DisplayPlanes(display,screen); gc= DefaultGC(display,screen); /* We need a visual class with changeable color maps. */ stat=XMatchVisualInfo(display,screen,depth,PseudoColor,visinfo); if(stat==0){ fprintf(stderr,"cannot get Pseudocolor class visual!\n"); exit(0); } visual=visinfo->visual; If there is not an appropriate visual it should just return 0 right? Any ideas folks? Note: Sun4 running X11/NeWS and OpenWindows. -------------------------------------------------------------------- ______ ___ Darren Anderson \ \ | _ anderdla@cs.uoregon.edu 1656 Walnut St. | | | / \ Eugene, Ore. 97403 | | | /___\ "MTV is like this very /_____/ | / \ big advertising agency, /______ \ and its only client is / \ \ itself." --------------------------------------------------------------------