[Tutor] Events in tkinter

alan.gauld@bt.com alan.gauld@bt.com
Tue Apr 1 07:57:01 2003

> How can I create the following event using classes?
> I want to type "control o", for example, and it call this function.

It seems to me that classes is kind of irrelevant to the question, 
why do you think that classes are needed?

What you need to do is bind the keypress even of some widget to 
the open function (but please rename it coz there are already 
open() functions in Python and that will get very confusing!)

As an example of catching ctrl characters from a Tk widget take 
a look at my Event Driven Programming tutor topic (it also uses 
classes FWIW).

Alan g.
Author of the Learn to Program website