No, not quite. (That is, if I'm undertanding you correctly in that you're trying to suppress the default keyboard focus traversal mechanism with the Tab key on certain windows.)
First of all, if you're not already familiar with
bindtags, I suggest you take a quick look at my replies in the threads Thread287-211083 and thread287-575956...
Okay, now that you're up to speed, you've probably figured out already what you need to do. The bindings for keyboard traversal appear in the [tt]all[/tt] bindtag. Because a widget's toplevel comes before the [tt]all[/tt] bindtag, we just need to suppress propagation of the [tt]<KeyPress-Tab>[/tt] events with a
break command, like this:
Code:
bind $top <KeyPress-Tab> {break}
In most cases, because of the "best event binding match" algorithm used by Tk, this should also catch the reverse traversal binding as well. The reverse traversal binding is typically mapped to a [tt]<Shift-KeyPress-Tab>[/tt] event, but actually implemented with a virtual event named [tt]<<PrevWindow>>[/tt]. To be safest, though, I'd explicitly include a binding for it as well on the toplevel, to ensure that reverse traversal is suppressed as well:
Code:
bind $top <<PrevWindow>> {break}
- Ken Jones, President, ken@avia-training.com
Avia Training and Consulting,
866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax