Posted to tcl by kostix at Mon Jul 10 21:49:23 GMT 2006view raw

  1. #! /usr/bin/wish
  2.  
  3. package require Tk
  4.  
  5. variable tmo 5
  6. variable trans 1
  7.  
  8. entry .tmo -textvariable tmo
  9. pack .tmo
  10.  
  11. checkbutton .trans -variable trans -text {Is transient?}
  12. pack .trans
  13.  
  14. button .start -text {Press, go to another desk and wait} \
  15. -command {
  16. after [expr $tmo * 1000] {
  17. toplevel .dlg
  18.  
  19. if {$trans} { wm transient .dlg . }
  20.  
  21. button .dlg.ok -text OK -command { destroy .dlg }
  22. pack .dlg.ok
  23. }
  24. }
  25. pack .start
  26.