usenet@bellcore.bellcore.com (Poster of News) (12/26/90)
I would like to use the params argument of an Xt action procedure to pass a pointer to a structure. Is this possible? If so, could someone send me some sample code or code excerpts to help me see how to do it? Debby Swayne dfs@bellcore.com
swick@ATHENA.MIT.EDU (Ralph Swick) (12/28/90)
I would like to use the params argument of an Xt action procedure to pass a pointer to a structure. Is this possible? Well, the argument is declared to be a list of Strings, and Strings are expected to be character pointers, but in principle you could cast any kind of pointer you wanted and include it in the list. However, the translation table parser only understands how to generate character strings params so the only way you could invoke an action procedure with a different type of pointer is to call it directly in your own code. When translations were initially designed, some thought was given to using full argument descriptors so that other types of action parameters could be specified but the idea was dropped in favor of simplicitly. There are several ways to associate your structure pointer with the widget id, if you really need to access dynamic data from within the action procedure.