Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!snorkelwacker!bloom-beacon!EXPO.LCS.MIT.EDU!kit From: kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: command widget bitmaps. Message-ID: <9003022138.AA19377@expo.lcs.mit.edu> Date: 2 Mar 90 21:38:16 GMT References: <9003022032.AA02828@mycroft.mayo.edu> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 33 > I am trying to use a bitmap instead of a label in a command widget. I had > assumed that one could set the bitmap in the same manner as a label so I used: > num_args = 0; > no_obj = XCreateBitmapFromData (XtDisplay(parent), > DefaultRootWindow (XtDisplay(parent)), > no_obj_bits, no_obj_width, no_obj_height); > XtSetArg (args[num_args], XtNbitmap, no_obj); > num_args++; > m_obj = XtCreateManagedWidget ("object", commandWidgetClass, parent, args, > num_args); This is fine. > XFreePixmap (XtDisplay(parent), no_obj); Don't free the pixmap, the label widget needs it. Add a destroy callback to the label widget that will free the pixmap when the label widget is destroyed. > I'd RTFM, but my copy of Athena Widget Set - C Language Interface (X11R4) > says: "See Converting Bitmaps for details), yet I can't find Converting Bitmaps > any where in the manual. Converting Bixmaps is section 2.4.3 (it's actually called Bitmap Conversion) sorry for the mixup. Chris D. Peterson MIT X Consortium Net: kit@expo.lcs.mit.edu Phone: (617) 253 - 9608 Address: MIT - Room NE43-213