tkinter text <Key> event
John McMonagle
jmcmonagle at velseis.com.au
Wed Sep 6 21:41:47 EDT 2006
On Wed, 2006-09-06 at 17:54 -0700, Jay wrote:
> I'm having trouble with using the <Key> event with the Text object.
> When I use them together (which is a logical combination), I use this
> code:
>
> textbox = Text(root, wrap="word", height=15, width=50)
> textbox.bind("<Key>", resolveGlyphs)
>
> def resolveGlyphs(event):
> textBuf = textbox.get(1.0, END)
> print(textBuf)
>
> What it prints out for me is everything except for the last character
> -- the one that triggered the event. How can I get the entire
> contents?
>
bind the textbox to the <KeyRelease> event because by then it has been
drawn on the Text widget. The <Key> event is equivalent to the
<KeyPress> event
Regards,
John
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the Python-list
mailing list