The Text Widget

Eric Brunel eric.brunel at pragmadev.com
Mon Mar 4 04:51:37 EST 2002


Edward K. Ream wrote:
> First, note that if you bind to a key-press (<Key>) event, when the
> event handler is called the Text widget hasn't been changed yet(!)
> Other frameworks provide a "text will change" event and a "text did
> change" event, but AFAIK Tk does not.

Tk does: it's simply that the event "<Key>" is a short-cut for 
"<KeyPress>", called when the key is depressed, so before the insertion 
happened. To do a binding after the text has been inserted, the event is 
"<KeyRelease>".

For Ali's problem, I don't exactly understand what you want to do. When 
reading your mail, it seems to me that a sub-class of Tkinter.Text with a 
redefined "insert" method may do the trick. Or is it more complicated?

HTH
 - eric -



More information about the Python-list mailing list