Tkinter plans

Steen Lumholt (
10 Jun 94 17:56:53 GMT

I'm (slowly) fixing the bugs in tkinter. This is the plan:

* Eliminate the need for Tcl code, in Tkinter based programs:
waitvar(), setvar() instead of say ('set', 'foo', 1)
[ I'm sure I forgot something here. ]

* method instead of xx.cmd('foo').

* Use methods in the Wm class, drop Wm.config ...

* xx.after: The patch from Guido did fix the problem, at least for me.
createcommand(...) deletes the old Tcl command (and decref the
Python function), so everything should be OK. There's still a memory
leak (Where?). But this works:
from Tkinter import *
t = Tk()
def xx():
print 'Hello'
t.after(1000, xx)

* Tcl_InitApp is now per default in tkintermethod.c, use WITH_INITAPP
to use an external Tcl_InitApp proc.

* Ignoring None in So that'wm', 'aspect', pathName)
can be written as'wm', 'aspect', pathName, None, None, None, None)

* Socket I/O stuff. I'll add
xx.createfilehandler(fd, mask, func) to tkintermethod.c. See the
Tk_CreateFileHandler function.

* Base class configuration. Why not use the class name instead
of 'packing'?
b = Button(m, {'text': 'Hello', Pack: {'fill': 'both'}})

* Tkinter widget library. I've put <>'s
EmacsText widget in

* I'll add a command to break out of the mainloop. But you will only
get a prompt if Python was stared with the -i option. (Is there an
"interactive mode variable" in Python?)