Changeset 1923 for branches/blt4/gui/scripts/pushbutton.tcl
- Timestamp:
- Oct 18, 2010 11:59:55 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4/gui/scripts/pushbutton.tcl
r1725 r1923 28 28 29 29 constructor {args} { 30 30 # defined below 31 31 } 32 32 destructor { 33 33 # defined below 34 34 } 35 35 … … 78 78 itcl::body Rappture::PushButton::invoke {} { 79 79 if { !$_enabled } { 80 80 puts "in invoke button not enabled" 81 81 return 82 82 } … … 127 127 upvar #0 $itk_option(-variable) var 128 128 if { $var != "" && [string is boolean $var] } { 129 129 set var [expr "$var == 1"] 130 130 } 131 131 if { $var == $onvalue } { 132 133 134 132 set _state 1 133 $itk_component(button) configure -relief sunken \ 134 -image $onimage -bg white 135 135 } else { 136 137 138 136 set _state 0 137 $itk_component(button) configure -relief raise \ 138 -image $offimage -bg grey85 139 139 } 140 140 } … … 162 162 itcl::configbody Rappture::PushButton::variable { 163 163 if {"" != $_variable} { 164 165 164 upvar #0 $_variable var 165 trace remove variable var write [itcl::code $this _fixValue] 166 166 } 167 167 set _variable $itk_option(-variable) 168 168 169 169 if {"" != $_variable} { 170 171 170 upvar #0 $_variable var 171 trace add variable var write [itcl::code $this _fixValue] 172 172 173 174 175 176 173 # sync to the current value of this variable 174 if {[info exists var]} { 175 _fixValue 176 } 177 177 } 178 178 }
Note: See TracChangeset
for help on using the changeset viewer.