Python GUI app to impress the boss?

Eric Brunel eric.brunel at
Wed Sep 18 10:46:36 CEST 2002

Lee Gray wrote:
> For a newbie, what's easier, Tk or wxWindows?

Matter of taste, really... I do prefer Tkinter, because I find it far 
simpler than other GUI toolkits. But then, I've been into Tk for some years 
now, and maybe I'm too used to it.

The first time I've looked at wxWindows and seen what's needed to open a 
simple window, it just made me run away screaming ;-). But seeing it again 
now, it's not that bad. See:

In fact, example one in this tutorial would be much shorter in Tkinter than 
in wxWindows, but examples 2 & 3 would require much more code in pure 
Tkinter because of the status bar: it's apparently automatically managed by 
wxWindows, but not by Tkinter. Adding Pmw to Tkinter would make things 
easier ( see ).

For the record, here is the equivalent (untested) Tkinter+Pmw code for 
examples 1 & 3 in the wxPython tutorial:

--- example 1 -------------------------
from Tkinter import *

topWdw = Tk()
topWdw.title("Hello from Tkinter")

--- example 3 -------------------------
from Tkinter import *
import Pmw

## Main window
topWdw = Tk()
topWdw.title("Hello from Tkinter")
## Status bar
statusBar = Pmw.MessageBar(topWdw)
statusBar.pack(side=BOTTOM, fill=X)
## Helper for menu items
helper = Pmw.Balloon(topWdw)
## Function displaying about screen
def showAbout():
  showinfo('About Me', "This sample program shows off\n"
                       "frames, menus, statusbars, and this\n"
                       "message dialog.")
## Menus
menuBar = Pmw.MainMenuBar(topWdw, balloon=helper)
menuBar.addmenu('File', '')
menuBar.addmenuitem('File', 'command',
                    'More information about this program',
                    label='About', command=showAbout)
menuBar.addmenuitem('File', 'separator')
menuBar.addmenuitem('File', 'command',
                    'Terminate the program',
                    label='Exit', command=topWdw.quit)

Just see for yourself the one you find clearer.

- Eric Brunel <eric.brunel at> -
PragmaDev : Real Time Software Development Tools -

More information about the Python-list mailing list