Re: Tk text, unset default bindings
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Tk text, unset default bindings

From: Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
Date: Tue Feb 28 2006 - 15:22:14 CET

Bryan Oakley wrote:
> # remove class binding completely:
> bind Text <Control-v> {}
> bind Text <Control-o> {}

It's almost never right to edit the class bindings, not when you can
copy them to a new bindtag, edit the bits there, and then use [bindtags]
to associate the new bindtag with the right widgets:

   # Copy...
   foreach seq [bind Text] {
      bind MyText $set [bind Text $seq]
   }
   # Modify...
   bind MyText <Control-v> { doSomething }
   # Install...
   bindtags .txt [list .txt MyText . all]

Donal.
Received on Sun Apr 30 02:17:49 2006