>> Just so I understand, can one call tcl/tk from C++ and such?
> Yes, most of my experience is just with the Tcl.framework though.
Yes, you can call Tk from C++, you can call C++ from Tk, and you can do
both at the same time. It sounds circular, but it all works out at link
You declare the Tk routines as external, and resolve them at link time
by linking to the Frameworks with compiler options like this:
-F../YourApp.app/Contents/Frameworks -framework Tcl -framework Tk
One of the routins you declare as external is:
This routine installs one of your own C (or C++ or Pascal or whatever)
routine as a command available in the TCLTK interpreter. Your routine
must have a particular format: particular parameters and result.
Inside your own C code, you call Tk routines by name. For example, you
can call Tcl_Eval, to which you pass a string that gets evaluated in the
Kevan Hashemi, Electrical Engineer
Physics Department, Brandeis University
Get latest updates about Open Source Projects, Conferences and News.