home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / tls / tls085.solintel.Z / tls085.solintel / lib / vtcl / tests / wmclose.tcl < prev    next >
Encoding:
Text File  |  1995-07-20  |  648 b   |  28 lines

  1. # CVS $Id: wmclose.tcl,v 1.3 1995/02/03 16:55:31 zibi Exp $
  2. #
  3. # Test the wmCloseCallback  ( WM_DELETE_WINDOW )
  4. #   Should give popup dialog in response to WmClose
  5.  
  6. # Response to WM Close
  7. proc wmCloseCB {cbs} {
  8.      set dialog [keylget cbs dialog]
  9.      
  10.      set dd [VtMessageDialog $dialog.msg \
  11.          -message "You've selected the close item"]
  12.      VtShow $dd
  13. }
  14.  
  15. # Clean exit applet
  16. proc ExitCB { cbd } { VtClose; exit 0 }
  17.  
  18.  
  19. set app [VtOpen CloseMe]
  20.  
  21. set dlog [VtMessageDialog $app.msg -message "Try the close item" \
  22.               -wmCloseCallback wmCloseCB \
  23.               -wmDecoration ALL \
  24.               -ok -okLabel Exit -okCallback ExitCB  ]
  25.  
  26. VtShow $dlog
  27. VtMainLoop
  28.