PtSpawn usage

I need to launch a script from my application, and it works with

pid=PtSpawn( wholeName, // const char *cmd,
args, // const char * const *argv,
NULL, // const char * const *env,
NULL, // const PtSpawnOptions_t *opt,
NULL, // PtSpawnCbF_t *cb,
NULL, // void *data,
NULL); // PtSpawnCbId_t **csp );

but I need to attach a callback. How do I declare a function that can be used with :
typedef void PtSpawnCbF_t( void *data, int status );

It is not clear to me how do I use that to declare another function that will be called after the spawned process finishes. I do need to pass a widget pointer to the callback, and data but I only see one void * argument.

So far I tried
pid=PtSpawn( wholeName, // const char *cmd,
args, // const char * const *argv,
NULL, // const char * const *env,
NULL, // const PtSpawnOptions_t *opt,
someFunction(*data,status), // PtSpawnCbF_t *cb,
*data, // void *data,
NULL); // PtSpawnCbId_t **csp );

and it compiles but the callback code does not get executed

Can someone show me an example or give me more information on the use of PtSpawn