(original) (raw)

# demonstrates how bindtags() wont recognize Tabs if I were to # swap the first two elements of the tuple 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_event) l_b_ts = text.bindtags() #text.bindtags((l_b_ts[1],l_b_ts[0],l_b_ts[2],l_b_ts[3])) # this wont recognize tabs text.bindtags = (l_b_ts[1],l_b_ts[0],l_b_ts[2],l_b_ts[3]) # this will recognize tabs, # but may have other unwanted side effects text.pack() root.mainloop()