
Why I am not reaching callbacks ?
Hello ,
I tried the following in a C++ program
integrating tcl/tk 8.0:
init()
{
int status;
status = Tcl_Init(interp);
if (status != TCL_OK)
abort();
status = Tk_Init(interp);
if (status == TCL_ERROR)
abort();
Tcl_Command cmdObj=
(Tcl_CreateObjCommand (interp,
const_cast <char*> ("stuff"),
(stuff_cmd),
static_cast <ClientData> (NULL),
static_cast <Tcl_CmdDeleteProc*>
(NULL)));
Tcl_Eval (interp, const_cast <char*> ("button .stuff -text \"Stuff\" -
command \"stuff\""));
Tcl_Eval (interp, const_cast <char*> ("pack .stuff"));
Tcl_Eval (interp, const_cast <char*> ("button .exit -text \"Exit\"
-command \"destroy .\""));
Tcl_Eval (interp, const_cast <char*> ("pack .exit"));
Tcl_DoOneEvent(0);
Tk_MainLoop();
...
Quote:
}
whereas the stuff_cmd is declared like this:
stuff_cmd (ClientData cData,
Tcl_Interp* interp,
int objc,
Tcl_Obj*CONST objv[])
{
return 0;
Quote:
}
I see in De{*filter*} that any one of these buttons
which appear when running the application (init()
is called from WinMain()) yields nothing. (We do not
reach the "stuff" metod).
Any idea why is it so ?
regards
sting