Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to register my TCL proc as Event Handler

Status
Not open for further replies.

sdytyct

Programmer
Jul 25, 2001
1
US
Hi:

Here's what my setup is:

I have a C++ exe on Windows that has the TCL interpretor stuff linked in. My TCL script is read, and processed by this exe. Now, here's what I want to do:

This exe is generating certain events. For some of these events I want a proc in one of my TCL scripts to be invoked. Also, I want to be able to register and deregister my TCL event handler by running TCL through the exe. For example:

handler.tcl contains "proc eventHandler{}"
"proc register{}" and "proc deregister{}".

When I run handler, and first call "proc register", I want all subsquent events of interest to invoke "proc eventHandler". Later, when "eventHandler" so desires, it can call deregister to stop the callback.

My question is: What do I need to do to do this? I am guessing that I will need to add events from my C++ piece onto the TCL event queue; but how do I setup my TCL "proc eventHandler" as the event handler?

Thanks a tonne!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top