[comp.windows.x] String to Pixmap conversion?

zebulon@csd.uwo.ca (Scott Feeney) (02/20/90)

I follow this group fairly regularly and haven't seen this problem mentioned
so I'm wondering what I'm doing wrong. I am trying to set things up in
my .Xdefaults file so that Athena command widgets have a backgroundPixmap of
(for arguments purposes) gray1. I gather (rightly or wrongly ?) from the
manual that I can give the filename of the bitmap file I wish to be used as
the value for backgroundPixmap and there will be an automagic conversion
of String to Bitmap. The manual talks about String to Bitmap conversion
although the Type required is Pixmap. The server (or whatever) realizes
this and attempts to do the String to pixmap conversion and promptly
throws up the following:

Warning: No type converter registered for 'String' to 'Pixmap' conversion.

Where am I going wrong?

Pertinent data:
X11R4 - Sun 3/60 - SunOS 4.0.3 - gcc-1.35

Xedit*Command*backgroundPixmap: gray1
\____________________________/
              |
              I realize this _could_ be wrong, but it _does_ try
                 to do the conversion...
              I am also assuming it will look in 
                /usr/include/X11/bitmaps for the file gray1.
TIA

- scott
---
Scott Feeney,  Research Associate,  Department of Computer Science
The University of Western Ontario,  London Canada, N6A 5B7
zebulon@csd.uwo.ca, zebulon@uwocsd.UUCP
---

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (02/21/90)

> I follow this group fairly regularly and haven't seen this problem mentioned
> so I'm wondering what I'm doing wrong. I am trying to set things up in
> my .Xdefaults file so that Athena command widgets have a backgroundPixmap of
> (for arguments purposes) gray1. I gather (rightly or wrongly ?) from the
> manual that I can give the filename of the bitmap file I wish to be used as
> the value for backgroundPixmap and there will be an automagic conversion
> of String to Bitmap. The manual talks about String to Bitmap conversion
> although the Type required is Pixmap. The server (or whatever) realizes
> this and attempts to do the String to pixmap conversion and promptly
> throws up the following:

> Warning: No type converter registered for 'String' to 'Pixmap' conversion.

> Where am I going wrong?


The background pixmap of a window must be the same depth as the window to which
it is to be assigned.  Since there is not current standard way to convert a
string into a pixmap of arbitrary depth neither the intrinsics or the Athena
widgets define a string to pixmap converter.  The Athena widgets do, however,
define a string to Bitmap (1 bit deep Pixmap) converter.  This converter takes
the name of a bitmap file, and converts that to a 1 bit deep Pixmap.

You are specifying the resource correctly, there just is no coverter defined
(registered) that knows how to convert the string "gray1" into a pixmap of
arbitrary depth.

						Chris D. Peterson     
						MIT X Consortium 

Net:	 kit@expo.lcs.mit.edu
Phone:   (617) 253 - 9608	
Address: MIT - Room NE43-213