Tcl HomeTcl Home Hosted by
ActiveState

Google SiteSearch

A Cup Of Coffee In The Morning?

Have A Cup Of Coffee...

Here's a nice cup of steaming coffee to get you started in the morning:

Source:

Here's the source for the animated cup of coffee. The T1_data variables are base64 encoded GIF images.

set T1_data {...}; set T2_data {...} etc.
foreach i [info globals T*_data] {
    image create photo $i -data [set $i]
    unset $i
}
set sequence {
    1 2 3 1 2 3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 10  11 12 13 14 15 10 11 12 13 14 15 10 11 12 13 14 15  10 11 12 13 14 15 10 11 12 13 14 15
}
proc cycle {{count 0} {delay 150}} {
    global sequence
    if {$count >= [llength $sequence]} {
	set count 0
    }
   .l configure -image T[lindex $sequence $count]_data
   after $delay "cycle [incr count] $delay"
}
label .l -bg white
pack .l
cycle