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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interfacing TK and C/C++

Status
Not open for further replies.

harishnp

Programmer
Jun 5, 2002
2
US
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top