textwidget.tag_bind("name", "<Any-KeyPress>", self.donothing) not working

shannonl shannonlayland at gmail.com
Tue Oct 25 15:01:29 EDT 2005


Hi all,

For some reason this bind is calling the donothing function, like it
should, but is then allowing the text to be inserted into the Text
widget.

Here is the code:

self.framebody.tag_config("name", underline=1)
self.framebody.tag_bind("name", "<Any-KeyPress>", self.donothing)

line = '\t%s' % ('sometext')
self.framebody.insert(END, line, "name")

def donothing(self):
    return 'break'

This donothing function should keep the tcl bind from inserting the
text...at least so I thought.

This bind does work on the text widget as a whole, but on a individual
tag, it does not.

Can anyone help me out with this?

Thanks in advance,
Shannon




More information about the Python-list mailing list