Unbind initial bind on basic widget (text)

Askari askari at addressNonValide.com
Tue Jun 15 17:04:53 EDT 2004


Peter Otten <__peter__ at web.de> wrote in
news:caevni$b0i$07$1 at news.t-online.com: 

> Askari wrote:
> 
>>    Do I can unbind the initial bind on basic widget? (ex.: the basic
>>    widget
>> Text have the bind "<Control-a>" for the return to the first caracter
>> of the line; but me I don't want this!)
>>    I try  'myText.unbind("<Control-a>")'    but the bind is not
>>    remove. 
>> :-(
> 
> I see two options.
> 
> 1. Prevent the event from being propagated to the class.
> 
> def breaker(*args):
>     return "break"
> 
> mytext.bind("<Control-a>", breaker)
> 
> 2. Unbind the event on the class level.
> 
> mytext.unbind_class("Text", "<Control-a>")
> 
>> N.B. I wan't disabled ALL initial bind (not just the "<Control-a>")
> 
> Maybe you should just disable the widget?
> 
> mytext["state"] = "disabled"
> 
> Peter
> 
> 

Thanks!!  :-)



More information about the Python-list mailing list