Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!mips!dimacs.rutgers.edu!seismo!bonnett From: bonnett@seismo.CSS.GOV (H. David Bonnett) Newsgroups: comp.windows.x.motif Subject: Re: Problem changing symbol pixmap for MessageBox widget Message-ID: <49696@seismo.CSS.GOV> Date: 11 Jun 91 18:53:44 GMT Article-I.D.: seismo.49696 References: <187@atesysv.UUCP> <191@atesysv.UUCP> Sender: usenet@seismo.CSS.GOV Organization: Center for Seismic Studies, Arlington, VA Lines: 34 In article <191@atesysv.UUCP>, lanzo@wgate.UUCP (Mark Lanzo) writes: |> 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. Hmmm, I don't have the time to really check this out myself, but what will happen with this upon exansion, given that XtSetArg is a macro itself that is evaluated twice (see D. Young's book, p24 -or- OSF Motif Prog Guide p3.6) This may be part of the problem since you inc the counter inside the (nested) macro calls. Just a thought.. -- -dave bonnett- Center for Seismic Studies; Arlington, VA bonnett@seismo.css.gov : All standard disclaimers apply.