I want to create a TK front end for a c/c++ back end. My plan is to create a GUI in TK that is called from C/C++. Can someone provide me with a method in which to create this?
I've provided some simple code below to illustrate what I don't know how to do.
##################################
==========
#hello.tcl
==========
button .b -text "Hello World" -command {
set var1 "foo"
exit
}
pack .b
##################################
With this tcl file, I want to create a simple c/c++ file that will run the hello.tcl script (maybe using Tcl_EvalFile?) and read the variable "var1" as "foo" so it can be used in the rest of the c/c++ code. Is this possible? Is there some way to keep track of a handle to the GUI or something? Any comments you can give will be helpful.
I've provided some simple code below to illustrate what I don't know how to do.
##################################
==========
#hello.tcl
==========
button .b -text "Hello World" -command {
set var1 "foo"
exit
}
pack .b
##################################
With this tcl file, I want to create a simple c/c++ file that will run the hello.tcl script (maybe using Tcl_EvalFile?) and read the variable "var1" as "foo" so it can be used in the rest of the c/c++ code. Is this possible? Is there some way to keep track of a handle to the GUI or something? Any comments you can give will be helpful.