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

  1. # tk busy does not mask off the keyboard events so we set the focus on
  2. # the busy window (_Busy) and ensure it will not process any <Tab> events
  3.  
  4. bind Busy <Tab> break
  5. bind Busy <Shift-Tab> break
  6.  
  7. proc Busy {dlg state} {
  8. variable _busy_$dlg
  9. if {$state} {
  10. set _busy_$dlg [focus]
  11. tk busy hold $dlg
  12. focus -force $dlg._Busy
  13. } else {
  14. if {[info exists _busy_$dlg]} {
  15. focus [set _busy_$dlg]
  16. unset _busy_$dlg
  17. }
  18. tk busy forget $dlg
  19. }
  20. }
  21.