Posted to tcl by kostix at Mon Jul 10 21:34:39 GMT 2006view raw

  1. #! /usr/bin/wish
  2.  
  3. package require Tk
  4. package require BWidget
  5.  
  6. variable tmo 5
  7. variable trans 1
  8.  
  9. entry .tmo -textvariable tmo
  10. pack .tmo
  11.  
  12. checkbutton .trans -variable trans -text {Is transient?}
  13. pack .trans
  14.  
  15. button .start -text {Press, go to another desk and wait} \
  16. -command {
  17. after [expr $tmo * 1000] {
  18. Dialog .dlg -title {It's me} \
  19. -separator 1 -anchor e \
  20. -modal none -default 1 -cancel 1 \
  21. -transient $trans
  22.  
  23. set f [.dlg getframe]
  24. button $f.ok -text OK -command { destroy .dlg }
  25. pack $f.ok
  26.  
  27. .dlg draw
  28. }
  29. }
  30. pack .start
  31.