J. C. Salomon
J. C. Salomon

Reputation: 4313

Using Tk with C

I’m a C programmer with no desire to deal with C++ tool-kits, and I’m trying to build a simple graphical card game. I’m programming under Linux, but I’d like to have the option of a Windows port. From what I’ve read, my options are GTK+ and Tk.

I’m working through some GTK+ tutorials, and I’ll probably stick with that, but I don’t think I’m giving Tk a fair shot. Trouble is, all the Tk documentation I can find is either for using Tk with {Tcl, Ruby, Perl, Python}, or for embedding a Tcl interpreter into the C program and using Tk that way. Is there an easy(-ish) way to use Tk to build GUIs for a C program without digressing too much into Tcl?

Ideally, is there a tutorial (something along the lines of the TkDocs Tk Tutorial) but using something like the Tk C API?

Upvotes: 24

Views: 27288

Answers (2)

OutOfBoundsException
OutOfBoundsException

Reputation: 197

Here are some useful links:

Combining C and tcl/tk
[An Overview of the Tk C Library][2]

Upvotes: 10

user613857
user613857

Reputation:

Here's a reference: http://www.hume.com/html85/indexes/tkc_api.html

Intro to combine C with Tk: http://davesource.com/Fringe/.../tcl_tk/tcl_C.html

Upvotes: 8

Related Questions