home *** CD-ROM | disk | FTP | other *** search
/ The Best of Windows 95.com 1996 September / WIN95_09962.iso / vrml / cp2b2x.exe / DATA.Z / manual.tcl < prev    next >
Text File  |  1996-06-26  |  730b  |  31 lines

  1. # This is a sample script for event handler.
  2.  
  3. set bRotating 0
  4. set timeoutHandler 0
  5.  
  6. proc myPeriodicRotate { obj event userData } {
  7.     global vsCSLocal
  8.     global vsRelative
  9.     global vsContinue
  10.     global bRotating
  11.  
  12.     vsRotateAngle $obj  0.0 10.0 10.0 $vsCSLocal $vsRelative
  13.     return $vsContinue
  14. }
  15.  
  16. proc myClickRotate { obj event userData } {
  17.    global bRotating  
  18.    global timeoutHandler
  19.    global vsTclScript
  20.    global vsPeriodicTask
  21.  
  22.   if {$bRotating == 0} {
  23.     set bRotating 1
  24.     set timeoutHandler [vsAddTimeOutHandler $obj 250 $vsTclScript "" myPeriodicRotate 0 $vsPeriodicTask]
  25.   } elseif {$bRotating == 1} {
  26.     set bRotating 0
  27.     vsRemoveTimeOutHandler $obj $timeoutHandler
  28.   }
  29. }
  30.  
  31.