It would be nice if there was a simple way to return
data to a tcl script without having to do something
like this:
char result[256];
sprintf(result, "%f", h->pos.x);
Tcl_SetResult( Togl_Interp(togl),
result,
TCL_VOLATILE);
return TCL_OK;
I'd rather see something like:
Togl_result_printf("%f", h->pos.x);
return TCL_OK;
I used to use mktclapp to add GUIs to my c/c++
programs, and it had functionality similar to what I am
describing. It was *extremely* helpful when coding to
have such a simple way to return data.
Logged In: YES
user_id=80530
What you want is Tcl_SetObjResult(interp,
Tcl_NewDoubleObj(h->pos.x))
Logged In: YES
user_id=745915
Hi Dan,
Give this a shot:
Tcl_SetVar2Ex(interp, "dummy", NULL,
Tcl_NewDoubleObj(h->pos.x), 0);
Logged In: YES
user_id=131838
Followups say it all.