[comp.windows.x] trouble with bitmaps under Aw

commike@cs.Buffalo.EDU (Alan Commike ) (02/15/90)

I've just started using the Athena widgets and the Xtoolkit. So much easier
than trying to get everything going with just Xlib!

I'm having problems getting a bitmap to display in a widget. There are no
examples to do this in the manuals, or in the example code supplied. 

What i'm trying to do is have a label widget with a bitmap. Do i have to
do resource conversions? Are there any toolkit functions to help with 
this. With Xlib i used to do an XCreateImage, and then PutPixel them
onto the window. There must be an easier simpler way under Aw.

Thanks for any and all help,

	...alan


-----------------------------------------------------------------------------
internet: commike@cs.buffalo.edu |         
bitnet: commike@sunybcs.BITNET   |        
uucp:  ..!{watmath,boulder,decvax,rutgers}!sunybcs!commike
Real-Life: Alan Commike - SUNY @ Buffalo, Buffalo NY

Q: How many computer scientists does it take to change a light bulb?
A: It's undecidable!
-----------------------------------------------------------------------------

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

> I've just started using the Athena widgets and the Xtoolkit. So much easier
> than trying to get everything going with just Xlib!

> I'm having problems getting a bitmap to display in a widget. There are no
> examples to do this in the manuals, or in the example code supplied. 

There is a string to bitmap converter registered in the Athena widgets.
The string is a filename that corrosponds to a file in the format produced
by XWriteBitmapFile.  

As an example try the following:

% cd /x/examples/Xaw
% xlabel -xrm "*label*bitmap:xlogo64"

For specifics on how the Athena string to bitmap converter works see
the Athena widget documentation section 2.4.3.

> What i'm trying to do is have a label widget with a bitmap. Do i have to
> do resource conversions? Are there any toolkit functions to help with 
> this. With Xlib i used to do an XCreateImage, and then PutPixel them
> onto the window. There must be an easier simpler way under Aw.

You can also use the SetValues() interface to place a pixmap of arbitrary depth
into the Label widget's XtNbitmap resource.  How you create this pixmap is up to
you, there a no tools provided by Xt, so you are relegated to using XLib calls.


						Chris D. Peterson     
						MIT X Consortium 

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