Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!newstop!sun!amdcad!dgcad!dg-rtp!wgate!lanzo From: lanzo@wgate.UUCP (Mark Lanzo) Newsgroups: comp.windows.x.motif Subject: Re: Problem changing symbol pixmap for MessageBox widget Message-ID: <191@atesysv.UUCP> Date: 10 Jun 91 18:03:14 GMT References: <187@atesysv.UUCP> Reply-To: lanzo@atesysv.UUCP (Mark Lanzo) Organization: Wandel & Goltermann Technologies, Inc. Lines: 35 In a prior article webb@cow.melco.co.jp (webb) wrote: > I think that your problem could be your XtSetValues, and XtGetValues. > These functions both take 3 parameters. Your program only passes 2 > parameters, the widget, and ARGS. You must also specify the number of > args as the 3rd parameter. Sigh. I suppose I should have gone ahead and shown the macro def's. As the old adage goes "assumption is the mother of all screwups." :-) At any rate, my def's actually look like: #define MAX_WIDGET_ARGS 16 #define ARGS WidgetArgs, WidgetArgCount #define ARGLIST_RESET() WidgetArgCount = 0 #define ARGLIST_ADD(tag,value) \ (XtSetArg(WidgetArgs[WidgetArgCount],tag,value), \ WidgetArgCount++) Arg WidgetArgs[MAX_WIDGET_ARGS]; Cardinal WidgetArgCount; So as you can see, the "ARGS" macro expands to two actual arguments. > Also you said that you wanted to use the foreground and background > colours of the text in the dialog box, so maybe you should use: > XtGetValues(label, ARGS, num_args); > instead of XtGetValues(dialog, ARGS) which you have now. I *did* try to get the colors from the label. They come back as fg=bg=0. I suspect this is because a label gadget is used in the message-box widget, rather than a label widget. It seems like it would have made more sense for XtGetValues to have returned the fg & bg colors for the parent window containing the label, but it doesn't appear to work that way. At any rate, the fg/bg colors for the message-box widget should have been the same as that used for the text; I just used the generic "*foreground" resource and didn't specify different colors for specific components of the message-box.