Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uwm.edu!spool.mu.edu!snorkelwacker.mit.edu!shelby!agate!apple!uokmax!munnari.oz.au!metro!dmssyd.syd.dms.CSIRO.AU!dmssyd.syd.dms.CSIRO.AU!kenm From: kenm@dmssyd.syd.dms.CSIRO.AU (Ken McNamara) Newsgroups: comp.sys.dec Subject: Using a non-default Visual on a DECSTATION 5000/200 (Help) Keywords: Visual , DEC Message-ID: <1991Feb21.214838.16052@syd.dms.CSIRO.AU> Date: 21 Feb 91 21:48:38 GMT Sender: news@syd.dms.CSIRO.AU Reply-To: kenm@dmssyd.syd.dms.CSIRO.AU (Ken McNamara) Organization: CSIRO Division of Mathematics and Statistics Lines: 196 I've written a small programme in attempt to create a widget with a window which is not of the default visual type. The code was written, compiled and run on a Sun 4/110 under SunOS 4.1. It doesn't bomb when the display is a Sun 4 running the MIT sample X server or a DECSTATION5000/200 with an 8 bit display running the DECWINDOWS DigitalEquipmentCorporation UWS2.2 server but it does bomb on a DECSTATION5000/200 running the UWS2.2 X-server with the following message X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 1 (X_CreateWindow) Minor opcode of failed request: 0 Resource id in failed request: 0x80071 Serial number of failed request: 270 Current serial number in output stream: 279 I was just wondering if anyone has experienced this problem ? The programme is : ------------------------------------------------------------------------------- #include #include #include #include #include #include #include #include static char *vis_class[6]; /* A table of Visual class names */ /* Routine to display a XVisulaInfo structure */ static void show_visual(vis) XVisualInfo vis ; { int class; printf ("depth = %d\n",vis.depth); class = vis.class; if (class >= 6) exit(1); printf("Visual Id = %#x \n",vis.visualid); printf ("class = %s\n",vis_class[class]); printf ("R mask = %#x \n",vis.red_mask); printf ("G mask = %#x \n",vis.green_mask); printf ("B mask = %#x \n",vis.blue_mask); printf ("colormap size = %d\n",vis.colormap_size); printf ("bits per rgb = %d\n",vis.bits_per_rgb); printf ("\n"); } main(argc,argv) int argc; char ** argv; { Widget shell; Widget box; Colormap Col1 ; XtAppContext app_context; Display * displ ; XVisualInfo Vis; Window w; Screen * scr; XColor col; int i,count; /* Initialise table of Visual class names */ vis_class[GrayScale] = "GrayScale"; vis_class[StaticGray] = "StaticGray"; vis_class[PseudoColor] = "PseudoColor"; vis_class[StaticColor] = "StaticColor"; vis_class[DirectColor] = "DirectColor"; vis_class[TrueColor] = "TrueColor" ; /* Do Xt stuff */ XtToolkitInitialize(); app_context = XtCreateApplicationContext(); /* Get display connection */ displ = XtOpenDisplay(app_context,"","Freddy","TESTS", NULL,0,&argc,argv); scr = DefaultScreenOfDisplay(displ); w = RootWindow(displ,DefaultScreen(displ)); i =XMatchVisualInfo(displ,DefaultScreen(displ),8,GrayScale,&Vis); printf("%d \n",i); if ( !i ) exit (0); /* Failed - exit without further comment */ show_visual(Vis); /* Display the XVisualInfo returned */ Col1 = XCreateColormap(displ,w,Vis.visual, AllocAll); /* Create the colormap */ printf("%#x \n",Col1); /* This is just a bit of nonsense to check that the coloramp is installed - when we enter the window the screen changes color */ for ( count=0; count