embed Tkinter in C

Will Ware wware at world.std.com
Wed Feb 7 14:19:41 EST 2001


Arvind Mani (marvind at glue.umd.edu) wrote:
> I am planning to build a user interface with Tkinter and integrate it with
> an existing C program.
> Can someone tell me where to find links to Tkinter C API and a tutorial

Tkinter is a Python wrapper for the Tk gui toolkit, which is written in
C and runs on Unix and Windows (and the Mac as well, I believe). If your
program is written in C, you might want to connect directly to the Tk
toolkit. Here's some info on Tk's C API:
http://www.bbso.njit.edu/Documentations/TclTkMan/tk4.2b1/tk4.2b1API.html

A possibly better strategy might be to create a Python wrapper for your
C code, and then write Python code that connects your C code to Tkinter.
This will probably be easier and more maintainable. Some resources that
would be useful for this are the Extending-and-Embedding tutorial:
http://www.python.org/doc/current/ext/ext.html
and Swig, an automatic generator for wrapper code:
http://www.swig.org/
http://www.swig.org/Doc1.1/HTML/Python.html

-- 
import string,time,os;print string.join((lambda x:x[:10]+x[8:])(map(
lambda x:string.center("*"*(lambda x:((x<24) ### Seasons Greetings, Will Ware
*(x-3))+3)(x),24),range(1,28, 2))),"\n") ################ wware at world.std.com



More information about the Python-list mailing list