jlf@earth.cray.COM (John Freeman) (01/17/89)
I read in the Athena Widget manual that one could use a bitmap
as a label instead of text. I could not find an example of
using XtNbitmap in clients or contrib, so I took the code for
xcommand.c in examples/Xaw and made the following changes:
1) changed -label to -bitmap
static XrmOptionDescRec options[] = {
{"-bitmap", "*bitmap", XrmoptionSepArg, NULL}
};
2) added a valid bitmap file name from /usr/include/X11/bitmaps
to the argument list using XtNbitmap:
static Arg args[] = {
{ XtNbitmap, (XtArgVal) "hobbes.bm" },
{ XtNcallback, (XtArgVal)callbacks },
};
--------------------------------------------------------------------
I always get this X Protocol Error:
X Protocol error: BadDrawable, invalid Pixmap or Window parameter
Major opcode of failed request: 14 (X_GetGeometry)
Minor opcode of failed request: 0
Resource id in failed request: 0x4005d
Serial number of failed request: 15
Current serial number in output stream: 15
Is there something else I need to do?swick@ATHENA.MIT.EDU (Ralph R. Swick) (01/17/89)
> I read in the Athena Widget manual that one could use a bitmap > as a label instead of text. True. > I could not find an example of > using XtNbitmap in clients or contrib Right, but look at clients/xmh/icons/XmhIcons.ad for fun & games (thanks to Chris Peterson @Athena) > 2) added a valid bitmap file name from /usr/include/X11/bitmaps > to the argument list using XtNbitmap: Standard error when setting resources via XtSetValues; you don't get representation type conversion. Try the following instead: examples/Xaw/xcommand -xrm '*Command.bitmap: /usr/include/X11/bitmaps/xlogo16'