callbacks from C/C++ 
Author Message
 callbacks from C/C++

Quote:

> Hi,

> We are planning to use SWIG to call C methods from Tcl/Tk script.
> What is the best way to invoke callbacks from C methods to Tcl/Tk procedures?
> Does SWIG support callbacks?

SWIG will write the main program code for you.  You can put code
into the %init block to save the interpreter pointer (interp).
From your C code, you can then call Tcl_Eval(interp,"command");

Bob

--

Mayo Foundation                                           (507) 284-2702
Rochester MN, 55905 USA   http://www.*-*-*.com/



Sat, 04 Aug 2001 03:00:00 GMT  
 callbacks from C/C++

Quote:


> > Hi,

> > We are planning to use SWIG to call C methods from Tcl/Tk script.
> > What is the best way to invoke callbacks from C methods to Tcl/Tk procedures?
> > Does SWIG support callbacks?

> SWIG will write the main program code for you.  You can put code
> into the %init block to save the interpreter pointer (interp).
> From your C code, you can then call Tcl_Eval(interp,"command");

Yes. Beware, though, not to do that without special care if you're
calling from another thread or from a signal handler. Do a DejaNews here
on 'AsyncMark' if you're in this case.

-Alex



Sun, 05 Aug 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. to CS: or not to CS: in F-PC assembler

2. Camp Smalltalk (CS 6) registration

3. APL as First Language for CS

4. SoftEng or CS Graduate Program Search

5. Test and Set (TS) vs Compare and Swap (CS)

6. Refactored Plus All Missing CS ANSI Tests In SIF

7. Camp Smalltalk (CS 6) registration

8. vwnc@cs.uiuc.edu

9. Next instr of the week - CS please

10. CS Books for Sale - Many Topics

11. CS Refactoring Browser Extensions

12. How I create a new file. ( .\CS\FILENAME)

 

 
Powered by phpBB® Forum Software