Text widget eats Tabs?
gods1child
alankarmisra at hotmail.com
Wed May 30 00:43:07 EDT 2001
Is this a bug or are there related issues i am missing. If it is a
bug, then I can report it, but i thought i'd ask here first. in case i
am missing something, i dont want to raise false alarms.
## start program
# demonstrates how a call to bindtags() to
# swap the first two elements of the bindtags tuple
# will make the Text widget insensitive to Tabs
from Tkinter import *
def key_event(event):
print 'keysym:' + event.keysym
root = Tk()
text = Text(root,height=10,width=50,font='courier 9')
text.bind("<Key>", key_event)
l_b_ts = text.bindtags()
# after the next line, the Key event wont be raised for Tabs
text.bindtags((l_b_ts[1],l_b_ts[0],l_b_ts[2],l_b_ts[3]))
text.pack()
root.mainloop()
More information about the Python-list
mailing list