Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!orion.oac.uci.edu!ucivax!zardoz.cpd.com!spsd!dg-rtp!wgate!atesysv!wgate.wgate.com From: lanzo@wgate.wgate.com (Mark Lanzo) Newsgroups: comp.windows.x.motif Subject: Problem changing symbol pixmap for MessageBox widget Message-ID: <187@atesysv.UUCP> Date: 31 May 91 16:13:35 GMT Sender: uucp@wgate.UUCP Organization: Wandel & Goltermann Technologies, RTP, NC Lines: 78 Quick question: I am trying to change the symbol pixmap on a MessageBox widget. I can change the symbol at _creation time_ for the widget, but I don't seem to have any luck at all changing it after it has been creating, using XtSetValues(). Is this a bug? Or am I just doing something stupid ... First, some background info: HP9000/370 running HP-UX version 7.0B Motif 1.0 with X11R3 Here's a sample code fragment (I assume you can figure out what my "ARGLIST" macros do): ARGLIST_RESET(); ARGLIST_ADD(XmNmessageString, msg_str); ARGLIST_ADD(XmNmessageAlignment, alignment); ARGLIST_ADD(XmNmappedWhenManaged, False); ARGLIST_ADD(XmNdialogType, XmDIALOG_MESSAGE); dialog = XmCreateMessageDialog(RootWidget, "Notice", ARGS); label = XmMessageBoxGetChild(dialog,XmDIALOG_MESSAGE_LABEL); XtManageChild(dialog); shell = XtParent(dialog); if (options.symbol_name) /* E.G. "wm_error" */ { Pixel fg, bg; Pixmap symbol; ARGLIST_RESET(); ARGLIST_ADD(XmNforeground, &fg); ARGLIST_ADD(XmNbackground, &bg); XtGetValues(dialog, ARGS); symbol = XmGetPixmap(screen,options.symbol_name,fg,bg); if (symbol != XmUNSPECIFIED_PIXMAP) { ARGLIST_RESET(); ARGLIST_ADD(XmNsymbolPixmap, symbol); XtSetValues(dialog, ARGS); } } Now, I can rearrange the code to go something like this: if (options.symbol_name) { Pixel fg, bg; ARGLIST_RESET(); ARGLIST_ADD(XmNforeground, &fg); ARGLIST_ADD(XmNbackground, &bg); XtGetValues(RootWidget, ARGS); symbol = XmGetPixmap(screen,options.symbol_name,fg,bg); if (symbol == XmUNSPECIFIED_PIXMAP) symbol = NULL; } ARGLIST_RESET(); ARGLIST_ADD(XmNmessageString, msg_str); ARGLIST_ADD(XmNmessageAlignment, alignment); ARGLIST_ADD(XmNmappedWhenManaged, False); ARGLIST_ADD(XmNdialogType, XmDIALOG_MESSAGE); if (symbol) ARGLIST_ADD(XmNsymbolPixmap, symbol); dialog = XmCreateMessageDialog(RootWidget, "Notice", ARGS); ... in which case it almost works. I do get my symbol; but it is not in the colors I wanted (I wanted it to be the same color as the message string). This is pretty much irrelevant though, since I'm more interested in why XtSetValues() doesn't work rather than what workarounds exist. Thanks in advance for any info you have, Mark