Xref: utzoo comp.lang.c:21521 comp.windows.x:13139 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!gatech!ken From: ken@gatech.edu (Ken Seefried III) Newsgroups: comp.lang.c,comp.windows.x Subject: varargs and X Keywords: varargs, Motif, X Windows, error handling, dialogs Message-ID: <19199@gatech.edu> Date: 6 Sep 89 21:06:13 GMT Organization: Dr. Tongue's House of Code... Lines: 51 --- I'm trying to build a general purpose error notification routine for an X11/Motif application that I am writing. I need to use varargs to get the error messages to the routine (printf() style). There is, however a catch. I also need to pass the parent widget ID to this routine. None of the several FM's that I have give any clue as to how I might do this. More or less, this is what I want to do (sans declarations, etc.): /*--------------------------------------------------------------------------*/ Widget Error( parent, va_list ) Widget parent; va_dcl { va_list vaargs; char *fmt; unsigned int foo = 0; Arg xmargs[ 24 ]; XmString msgStr_xm; Widget error_dialog; char buffer[ 1024 ]; va_start( vaargs ); fmt = va_arg( args, char * ); vsscanf( buffer, fmt, vaargs ); msgStr_xm = XmStringCreate( buffer, CS ); XtSetArgs( xmargs[ foo ], XmNmessageString, MsgStr_xm ); foo++; error_dialog = XmCreateErrorDialog( parent, "Error", xmargs, foo ); . . . /*-------------------------------------------------------------------------*/ Anyone have any insight into the deep dark mysteries of varargs? Any help would be greatly appreciated... ...ken seefried iii ...!!gatech!ken ken@gatech.edu