Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!po From: po@cs.utexas.edu (Po Ling Cheung) Newsgroups: comp.windows.x Subject: Problems with XtNbitmap Keywords: label wiget, Athena, bitmap Message-ID: <4290@cs.utexas.edu> Date: 9 Dec 88 23:28:12 GMT Organization: U. Texas CS Dept., Austin, Texas Lines: 36 I have problems displaying a bitmap file using the XtNbitmap resource in a label widget. First I tried specifying a file name but I got an X Protocol error: toplevel = XtInitialize( NULL, "DEmo", NULL, 0, &argc, argv); XtSetArg(args[0], XtNbitmap, "/usr/include/X11/bitmaps/xlogo16"); xlogo = XtCreateManagedWidget("xlogo", labelWidgetClass, toplevel, args, 1); XtRealizeWidget(toplevel); XtMainLoop(); 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: 0x25c3c Serial number of failed request: 14 Current serial number in output stream: 14 Next I tried creating the pixmap by replacing the XtSetArg call with: #include dpy = XtDisplay(toplevel); XtSetArg(args[0], XtNbitmap, XCreateBitmapFromData (dpy, DefaultRootWindow(dpy), xlogo16_bits, xlogo16_width, xlogo16_height)); The label widget shows up but the contents is some colored garbage instead of the xlogo I want. Eventually, I want to be able to display my own bitmap file on a label widget. What am I doing wrong? Could someone please give me some hints? Thanks, Po Cheung ... po@cs.utexas.edu