Changeset 1923 for branches/blt4/gui/scripts/animicon.tcl
- Timestamp:
- Oct 18, 2010, 11:59:55 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4/gui/scripts/animicon.tcl
r1342 r1923 45 45 itcl::body Rappture::Animicon::constructor {args} { 46 46 itk_component add icon { 47 47 label $itk_interior.icon 48 48 } 49 49 pack $itk_component(icon) -expand yes -fill both … … 61 61 itcl::body Rappture::Animicon::start {} { 62 62 if {![isrunning]} { 63 63 _next 64 64 } 65 65 } … … 74 74 itcl::body Rappture::Animicon::stop {} { 75 75 if {[isrunning]} { 76 77 76 after cancel $_afterid 77 set _afterid "" 78 78 } 79 79 } … … 97 97 $itk_component(icon) configure -image $_frames($_pos) 98 98 if {[incr _pos] >= [array size _frames]} { 99 99 set _pos 0 100 100 } 101 101 set _afterid [after $itk_option(-delay) [itcl::code $this _next]] … … 113 113 catch {unset _frames} 114 114 if {[llength $itk_option(-images)] >= 1} { 115 116 117 118 119 120 121 122 123 124 125 126 127 115 set w 0 116 set h 0 117 set i 0 118 foreach name $itk_option(-images) { 119 set imh [Rappture::icon $name] 120 if {"" == $imh} { 121 error "image not found: $name" 122 } 123 set _frames($i) $imh 124 if {[image width $imh] > $w} { set w [image width $imh] } 125 if {[image height $imh] > $h} { set h [image height $imh] } 126 incr i 127 } 128 128 } 129 129 … … 132 132 133 133 if {$restart} { 134 134 start 135 135 } 136 136 }
Note: See TracChangeset
for help on using the changeset viewer.