Path: utzoo!attcan!uunet!bloom-beacon!ATHENA.MIT.EDU!swick From: swick@ATHENA.MIT.EDU (Ralph R. Swick) Newsgroups: comp.windows.x Subject: Re: XtConvert() again Message-ID: <8909251453.AA16356@LYRE.MIT.EDU> Date: 25 Sep 89 14:53:41 GMT References: <962@tub.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Organization: DEC/MIT Project Athena Lines: 20 > I don't quite understand > how the result of a call to XtConvert() (a caddr_t) can be placed into > an argument to e.g. XtSetValues(). In general, it can't; you have to hard-code some knowledge about the C datatype of the result of the conversion; i.e. the specific type of object pointed to by result.addr. E.g. if you "know" the result of the conversion is an int, you can say XtSetArg (args[n], XtNsomething, *(int *)result.addr); In the special case of ArgLists, you can get away with just looking at the size of the returned conversion result, since that determines how it is "widened" to an XtArgVal. > Do I really have to > write a switch statement with one case for each possible destination type > (like the ugly switch in CopyFromArg() in lib/Xt/Resources.c)? For a higher-level generic interface, unfortunately yes.