Apr 28, 2009

GUI programming with Python and Tkinter

Python supports since a long time the GUI programming by using the
Tkinter module. With Version 3.0 on Windows the modules seems to be named
tkinter. On Version 2.6 it is still Tkinter.

I'm using Netbeans 6.7 M3 as an IDE for programming.
For a good introduction to Tkinter, I found the documentation from the
New Mexico Tech Computer Center. You find the Python section here and the
PDF for Tkinter here.

With 6.7 it is partly hard to program the GUI, when you do not know the API,
because the code completion works only with
from Tkinter import Tk

and then the code completion on the Tk doesn't work.
So you have to know the API.
What I do in this case, is to issue a
print dir(var)
So you can start the application in Netbeans, even with a Tkinter GUI and
the output window shows the attributes of the object.