Using Tk with C

我是研究僧i 提交于 2019-12-03 12:06:27

问题


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?


回答1:


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




回答2:


Here are some useful links:

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




回答3:


It's nowhere near as advanced as TKDocs tutorials, but here is some information:

http://www.gibmonks.com/practical-programming/ch47lev1sec2.html

There also appears to be a chapter in Practical Programming in Tcl and TK



来源:https://stackoverflow.com/questions/8550096/using-tk-with-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!