Posted to tcl by patthoyts at Mon Feb 08 14:17:44 GMT 2010view pretty

# tk busy does not mask off the keyboard events so we set the focus on 
# the busy window (_Busy) and ensure it will not process any <Tab> events

bind Busy <Tab> break
bind Busy <Shift-Tab> break

proc Busy {dlg state} {
    variable _busy_$dlg
    if {$state} {
        set _busy_$dlg [focus]
        tk busy hold $dlg
        focus -force $dlg._Busy
    } else {
        if {[info exists _busy_$dlg]} {
            focus [set _busy_$dlg]
            unset _busy_$dlg
        }
        tk busy forget $dlg
    }
}