OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [itcl/] [iwidgets3.0.0/] [demos/] [spinint] - Blame information for rev 578

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.