home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 May / PCWorld_2002-05_cd.bin / Software / TemaCD / activetcltk / ActiveTcl8.3.4.1-8.win32-ix86.exe / ActiveTcl8.3.4.1-win32-ix86 / demos / IWidgets / spinint < prev    next >
Encoding:
Text File  |  2001-10-22  |  833 b   |  30 lines

  1. # ----------------------------------------------------------------------
  2. #  DEMO: spinint in [incr Widgets]
  3. # ----------------------------------------------------------------------
  4. package require Iwidgets 4.0
  5.  
  6. option add *textBackground seashell
  7. . configure -background white
  8.  
  9. iwidgets::spinint .times -labeltext "Countdown:" -range {0 10} -width 3
  10. pack .times -padx 10 -pady 10
  11.  
  12. .times delete 0 end
  13. .times insert end "5"
  14.  
  15. frame .test
  16. pack .test -padx 10 -pady 10
  17. button .test.go -text "Go" -command {
  18.     set count [.times get]
  19.     while {$count >= 0} {
  20.         .test.readout configure -text $count
  21.         update
  22.         after 200
  23.         incr count -1
  24.     }
  25.     .test.readout configure -text "blast-off!"
  26. }
  27. pack .test.go -side left
  28. label .test.readout -width 15 -background seashell
  29. pack .test.readout -side left -padx 4 -pady 4
  30.