Changeset 95 for trunk/gui/scripts/scroller.tcl
- Timestamp:
- Oct 9, 2005 9:41:29 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/scroller.tcl
r44 r95 35 35 protected method _fixframe {which} 36 36 protected method _fixsize {} 37 protected method _lock {option }37 protected method _lock {option which} 38 38 39 39 private variable _dispatcher "" ;# dispatcher for !events 40 40 private variable _contents "" ;# widget being controlled 41 41 private variable _frame "" ;# for "contents frame" calls 42 private variable _lock 0 ;# for _lock on x-scrollbar42 private variable _lock ;# for _lock on x/y scrollbar 43 43 } 44 44 … … 54 54 # ---------------------------------------------------------------------- 55 55 itcl::body Rappture::Scroller::constructor {args} { 56 array set _lock { x 0 y 0 } 57 56 58 Rappture::dispatcher _dispatcher 57 59 … … 196 198 x { 197 199 if {$state} { 198 grid $itk_component(xsbar) -row 1 -column 0 -sticky ew 199 _lock set 200 if {![_lock active x]} { 201 grid $itk_component(xsbar) -row 1 -column 0 -sticky ew 202 } 200 203 } else { 201 if {![_lock active]} { 202 grid forget $itk_component(xsbar) 203 } 204 grid forget $itk_component(xsbar) 205 _lock set x 204 206 } 205 207 } 206 208 y { 207 209 if {$state} { 208 grid $itk_component(ysbar) -row 0 -column 1 -sticky ns 210 if {![_lock active y]} { 211 grid $itk_component(ysbar) -row 0 -column 1 -sticky ns 212 } 209 213 } else { 210 214 grid forget $itk_component(ysbar) 215 _lock set y 211 216 } 212 217 } … … 263 268 264 269 # ---------------------------------------------------------------------- 265 # USAGE: _lock set 266 # USAGE: _lock reset 267 # USAGE: _lock active 270 # USAGE: _lock set <which> 271 # USAGE: _lock reset <which> 272 # USAGE: _lock active <which> 268 273 # 269 274 # Used internally to lock out vibrations when the x-scrollbar pops … … 275 280 # up. 276 281 # ---------------------------------------------------------------------- 277 itcl::body Rappture::Scroller::_lock {option } {282 itcl::body Rappture::Scroller::_lock {option which} { 278 283 switch -- $option { 279 284 set { 280 set _lock 1281 after cancel [itcl::code $this _lock reset ]282 after 50 [itcl::code $this _lock reset ]285 set _lock($which) 1 286 after cancel [itcl::code $this _lock reset $which] 287 after 50 [itcl::code $this _lock reset $which] 283 288 } 284 289 reset { 285 set _lock 0290 set _lock($which) 0 286 291 } 287 292 active { 288 return $_lock 293 return $_lock($which) 289 294 } 290 295 default {
Note: See TracChangeset
for help on using the changeset viewer.