[comp.windows.x.motif] Creating a Pixmap from a .xbm file

p_davis@epik.enet.dec.com (Peter Davis) (02/08/91)

I'd like to be able to dynamically pass a bitmap to an XmToggleButton widget to
be used as either the labelPixmap or the selectPixmap.  The actual data bits are
in an xbitmap file which I'd like to #include in my c source.  Is there an easy
way to do this?

The Programmer's Reference indicates that the labelPixmap and selectPixmap
resources must be set with data of type Pixmap.  In other words, in order to use
XtSetArg to set the value of the widget's resource, I have to pass a Pixmap. Is
this an X pixmap?  Do I have to create a Pixmap, draw the picture into it, and
then pass it?  Is there an easy way to do this from an X bitmap file?

Thanks.
-pd

klee@wsl.dec.com (Ken Lee) (02/08/91)

In article <19966@shlump.nac.dec.com>, p_davis@epik.enet.dec.com (Peter Davis) writes:
|> 
|> I'd like to be able to dynamically pass a bitmap to an XmToggleButton widget to
|> be used as either the labelPixmap or the selectPixmap.  The actual data bits are
|> in an xbitmap file which I'd like to #include in my c source.  Is there an easy
|> way to do this?

XCreateBitmapFromData().  A bitmap is a pixmap with depth 1.

-- 
Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@wsl.dec.com
uucp: uunet!decwrl!klee