home *** CD-ROM | disk | FTP | other *** search
/ Practical Programming in Tcl & Tk (4th Edition) / TCLBOOK4.BIN / mac / exsource.old / 23_2.tcl < prev    next >
Text File  |  2003-04-15  |  338b  |  23 lines

  1. #
  2. # Example 23-2
  3. # A platform-specific cancel event.
  4. #
  5.  
  6. proc Platform_CancelEvent {} {
  7.     global tcl_platform
  8.     switch $tcl_platform(platform) {
  9.         unix {
  10.             event add <<Cancel>> <Control-c>
  11.         }
  12.         windows {
  13.             event add <<Cancel>> <Escape>
  14.         }
  15.         macintosh {
  16.             event add <<Cancel>> <Command-period>
  17.         }
  18.     }
  19. }
  20. bind .top.entry <<Cancel>> Stop
  21.  
  22.  
  23.