So we have code like:
#include "cpptk.h" #include <stdio.h> using namespace Tk; void hello() { puts("Hello C++/Tk!"); } int main(int, char *argv[]) { static char* str = "button .a -text "Say Hello ppure TCL"\n" "pack .a\n"; init(argv[0]); button(".b") -text("Say Hello") -command(hello); pack(".b") -padx(20) -pady(6); runEventLoop(); } imagine str is complex tcl code. We want to feed it to C++/Tk as a string. Also we want to have it exequted in the same TCL vm our general C++/Tk programm with gui we created in C++/Tk code runs. So the result of this code would be 2 buttons inside a window. How to do such thing?
How to do such thing?