[Tutor] using TK to view an image and then close the window

jfouhy at paradise.net.nz jfouhy at paradise.net.nz
Tue Apr 26 01:18:46 CEST 2005

Quoting "Ertl, John" <john.ertl at fnmoc.navy.mil>:

>  top = Tkinter.Toplevel(app,visual="truecolor",colormap="new")
>  top.title(mainTitle)
>  top.protocol("WM_DELETE_WINDOW", quit)
>  top.bind("<q>",quit)
>  top.bind("<Q>",quit)

In addition to Michael's comments, to bind to a keypress, you just do (eg)
widget.bind("q", f).


More information about the Tutor mailing list