Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!rutgers!bellcore-2!bellcore!cellar!aw From: aw@cellar.bae.bellcore.com (Andrew Wason) Newsgroups: comp.windows.x Subject: menu with installed colormap Message-ID: <1990Sep14.222840@cellar.bae.bellcore.com> Date: 15 Sep 90 02:28:40 GMT Sender: news@bellcore.bellcore.com Reply-To: aw@cellar.bae.bellcore.com Organization: Bell Communications Research Lines: 40 I have a client which needs its own colormap. I created a colormap and set the XtNcolormap resource of the topLevelShell widget to this colormap. I allocated 250 cells read/write out of the colormap, leaving 6 cells shareable. I also have a simpleMenu widget which pops up in the topLevel widget. I checked, and the simpleMenu XtNcolormap resource is set correctly to my new colormap (because it copies from parent by default). However, the menu is unreadable due to the colors it is using. The simpleMenu uses XtDefaultForeground and XtDefaultBackground as its default colors. In lib/Xt/Converters.c CvtStringToPixel() these strings are converted to BlackPixelOfScreen() and WhitePixelOfScreen(). These two macros return pixel values relative to the default colormap. So, even though my colormap is currently installed, the simpleMenu pops up with its foreground/background pixel values incorrectly set based on the default colormap. In CvtStringToPixel(), if the color string is anything other than XtDefaultForeground or XtDefaultBackground then the currently installed colormap is used. Why is the currently installed colormap ignored for these two strings? Is this a bug in the Intrinsics? Specifying the following in my resources makes everything work fine: (since these strings are not XtDefaultForeground or XtDefaultBackground, the currently installed colormap is used to determine their pixel values): *SimpleMenu*foreground: black *SimpleMenu*background: white Thanks, Andrew -------------------------------------------------------------------------------- Andrew Wason Bell Communications Research aw@cellar.bae.bellcore.com Piscataway, NJ bellcore!cellar!aw