Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!po From: po@cs.utexas.edu (Po Ling Cheung) Newsgroups: comp.windows.x Subject: Problem in displaying XtNbitmap in a label widget Keywords: label widget, bitmap, pixmap Message-ID: <4360@cs.utexas.edu> Date: 16 Dec 88 02:00:28 GMT Organization: U. Texas CS Dept., Austin, Texas Lines: 64 I posted an article earlier about problems with XtNbitmap but got no response. Here is another version of my program that doesn't work. The error message and stack frames are also shown below. I have no idea what's wrong with it. Would someone please test run the program and see if it displays the xlogo ? If not? Why not? -------------------------------------------------------------------------------- #include #include #include void main(argc, argv) int argc; char **argv; { Widget toplevel, xlogo; Arg args[10]; toplevel = XtInitialize( NULL, "DEmo", NULL, 0, &argc, argv); xlogo = XtCreateManagedWidget("xlogo", labelWidgetClass, toplevel, NULL, 0); XtSetArg(args[0], XtNbitmap, XCreateBitmapFromData (XtDisplay(xlogo), XtWindow(xlogo), xlogo16_bits, xlogo16_width, xlogo16_height)); XtSetValues(xlogo, args, 1); XtRealizeWidget(toplevel); XtMainLoop(); } -------------------------------------------------------------------------------- /* Run-time error X Protocol error: BadDrawable, invalid Pixmap or Window parameter Major opcode of failed request: 53 (X_CreatePixmap) Minor opcode of failed request: 0 Resource id in failed request: 0x0 Serial number of failed request: 14 Current serial number in output stream: 18 */ /* debugger info (dbx) where exit(0x1) at 0x25871 _XDefaultError(0x3e804, 0x7fffd9a8) at 0x1b394 _XError(0x3e804, 0x7fffda24) at 0x1b126 _XReply(0x3e804, 0x7fffda24, 0x0, 0x1) at 0x1aa33 XGetGeometry(0x3e804, 0x600006, 0x7fffdaa0, 0x7fffda9c, 0x7fffda98, 0x7fffda94, 0x7fffda90, 0x7fffda8c, 0x7fffda88) at 0x1466c SetTextWidthAndHeight(0x3f304) at 0x156 Label.SetValues(0x7fffde48, 0x7fffdc54, 0x3f304) at 0x7cd CallSetValues(0x25d80, 0x7fffde48, 0x7fffdc54, 0x3f304, 0x7fffe06c, 0x1) at 0x8c ca XtSetValues(0x3f304, 0x7fffe06c, 0x1) at 0x8f62 main(argc = 1, argv = 0x7fffe0ec, 0x7fffe0f4), line 17 in "xlogo2.c" */ Thank you! Po (po@cs.utexas.edu)