Re: BWidget <<TreeSelect>> + keyboard navigation
- From: Kevin Walzer <kw@xxxxxxxxxxxxxxx>
- Date: Tue, 31 Jul 2007 11:12:43 -0400
Bryan Oakley wrote:
No surprise. Look at the documentation for bind and you'll see that third argument should be the name of a script. Unless you have a procedure named <<TreeSelect>> it won't work (though, it should throw an error if the binding is being processed).
So first, you need to generate the virtual event on the keypress like so:
bind $Tree <KeyPress-Up> [list event generate $Tree <<TreeSelect>>]
I played around with this a bit, and it didn't work. Then I remembered that custom bindings on BWidgets sometimes need to be set on the underling canvas, like so:
bind $Tree.c <KeyPress-Up> [list event generate $Tree <<TreeSelect>>]
This works, sort of. It triggers the <<TreeSelect>> event, and the command I've bound to <<TreeSelect>>. However, it won't release the selection; keyboard navigation no longer works.
After looking at the "event" and "bind" man pages a bit more, I realized I needed to add a "+" to the command:
+event generate...
And trying the syntax in this fashion:
bind $Tree.c <KeyPress-Up> [list +event generate $Tree <<TreeSelect>>]
This works the way it's supposed to. It appends the <<TreeSelect>> event to the keyboard navigation already provided by the <KeyPress-Up> binding, rather than replacing the existing bindings.
Thanks for the clarification.
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
.
- References:
- BWidget <<TreeSelect>> + keyboard navigation
- From: Kevin Walzer
- Re: BWidget <<TreeSelect>> + keyboard navigation
- From: Bryan Oakley
- BWidget <<TreeSelect>> + keyboard navigation
- Prev by Date: Re: tclkit.exe description
- Next by Date: Re: Cache complex list for faster performance
- Previous by thread: Re: BWidget <<TreeSelect>> + keyboard navigation
- Next by thread: ANNOUNCE: Tao 8.5.0
- Index(es):