Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!elroy.jpl.nasa.gov!aristotle!pjs From: pjs@aristotle.JPL.NASA.gov (Peter Scott) Newsgroups: comp.windows.x.motif Subject: Loading pixmap in drawn button on color display? Message-ID: <1990Aug27.005946.5857@elroy.jpl.nasa.gov> Date: 27 Aug 90 00:59:46 GMT Sender: news@elroy.jpl.nasa.gov (Usenet) Reply-To: pjs@aristotle.jpl.nasa.gov Followup-To: comp.windows.x.motif Organization: Jet Propulsion Laboratory, NASA/Caltech Lines: 26 Nntp-Posting-Host: aristotle.jpl.nasa.gov I have an application which fills a drawnbutton with a pixmap read from a file picked by the user so they can preview it. (The bitmaps are from /usr/include/X11/bitmaps and I convert them to pixmaps with XReadBitmapFile). Worked fine on our monochrome displays. I just went to a color workstation that I have occasional access to, and got the error X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 55 (X_CreateGC) Minor opcode of failed request: 0 Resource id in failed request: 0x800025 Serial number of failed request: 57 Current serial number in output stream: 122 After a while of scratching my head, it dawned on me that the problem was in the drawnbutton, and was because the color w/s ihas an 8-bit deep display. I recall reading something about this here lately. Anyway, I tried setting the depth resource to 1 in the argument list in the widget creation call, but that didn't help. How can I write something which works on mono and color displays? More to the point, why can't the drawnbutton figure it out for itself??? -- This is news. This is your | Peter Scott, NASA/JPL/Caltech brain on news. Any questions? | (pjs@aristotle.jpl.nasa.gov)