Extending Python/Tkinter

Eric Brunel eric.brunel at pragmadev.com
Tue Mar 19 12:52:42 EST 2002


Cris Eck wrote:
> I have a C++ class that draws maps that I've been assigned to extend
> into python.  The class uses X primitive calls (XDrawPoint, etc.) to
> do much of the work and I'm at a loss on how to integrate this as an
> extension to Python.  Initially I thought  I could get a drawable,
> display and graphics context from the Tk C API.  Then I saw that
> Tkinter is using the Tcl interpreter and not calling the Tk routines
> directly.  Now I'm lost.

Hi Cris,

I'm just the opposite of you (knowing quite well Tk/Tkinter, but nothing 
about X primitives), but I saw once in the comp.lang.tcl newsgroup that you 
could use the equivalent of the winfo_id method on Tkinter widgets to get 
the internal X11 window id, that you should be able to use at the X11 
level. You'll find more info in the Tk manuals, e.g. at 
http://dev.scriptics.com/man/tcl8.3/TkCmd/winfo.htm

I don't know however if it can be of any help for you...
 - eric -




More information about the Python-list mailing list