#BUGFIX by sr expecco_2_9_0 expecco_2_9_0_win75_lx36 expecco_2_9_1
authorsr
Tue, 10 May 2016 14:02:17 +0200
changeset 5730 1fe161a855da
parent 5729 bbd01417740f
child 5731 00e37b96afea
#BUGFIX by sr class: ScrollableView changed: #setScrollActions care for late incoming (pushed) scrill events, which are handled after the scrolledView has already been deconstructed.
ScrollableView.st
--- a/ScrollableView.st	Mon May 09 19:45:52 2016 +0200
+++ b/ScrollableView.st	Tue May 10 14:02:17 2016 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
               All Rights Reserved
@@ -1784,54 +1786,86 @@
     ].
     
     vScrollBar notNil ifTrue:[
-        vScrollBar scrollAction:[:position |
-            lockUpdates := true.
-            scrolledView scrollVerticalToPercent:position.
-            lockUpdates := false
-        ].
-        vScrollBar 
-            scrollUpAction:[ |sensor|
-                            sensor := self sensor.
-                            (sensor shiftDown or:[sensor ctrlDown]) ifTrue:[
-                                scrolledView scrollToTop
-                            ] ifFalse:[
-                                scrolledView scrollUp
-                            ]
-                           ].
-        vScrollBar 
-            scrollDownAction:[|sensor|
-                            sensor := self sensor.
-                            (sensor shiftDown or:[sensor ctrlDown]) ifTrue:[
-                                scrolledView scrollToBottom
-                            ] ifFalse:[
-                                scrolledView scrollDown
-                            ]
-                           ].
+        vScrollBar scrollAction:
+            [:position |
+                "/ in case the event came after the view was already deconstructed
+                scrolledView notNil ifTrue:[
+                    lockUpdates := true.
+                    scrolledView scrollVerticalToPercent:position.
+                    lockUpdates := false
+                ].
+            ].
+
+        vScrollBar scrollUpAction:
+            [   
+                |sensor|
+                "/ in case the event came after the view was already deconstructed
+                scrolledView notNil ifTrue:[
+                    sensor := self sensor.
+                    (sensor shiftDown or:[sensor ctrlDown]) ifTrue:[
+                        scrolledView scrollToTop
+                    ] ifFalse:[
+                        scrolledView scrollUp
+                    ]
+                ].
+            ].
+
+        vScrollBar scrollDownAction:
+            [   
+                |sensor|
+
+                "/ in case the event came after the view was already deconstructed
+                scrolledView notNil ifTrue:[
+                    sensor := self sensor.
+                    (sensor shiftDown or:[sensor ctrlDown]) ifTrue:[
+                        scrolledView scrollToBottom
+                    ] ifFalse:[
+                        scrolledView scrollDown
+                    ]
+                ].
+            ].
     ].
+
     hScrollBar notNil ifTrue:[
-        hScrollBar scrollAction:[:position |
-            lockUpdates := true.
-            scrolledView scrollHorizontalToPercent:position.
-            lockUpdates := false
-        ].
-        hScrollBar 
-            scrollUpAction:[|sensor|
-                            sensor := self sensor.
-                            (sensor shiftDown or:[sensor ctrlDown]) ifTrue:[
-                                scrolledView scrollToLeft
-                            ] ifFalse:[
-                                scrolledView scrollLeft
-                            ]
-                           ].
-        hScrollBar 
-            scrollDownAction:[|sensor|
-                            sensor := self sensor.
-                            (sensor shiftDown or:[sensor ctrlDown]) ifTrue:[
-                                scrolledView scrollToRight
-                            ] ifFalse:[
-                                scrolledView scrollRight
-                            ]
-                             ].
+        hScrollBar scrollAction:
+            [:position |
+                "/ in case the event came after the view was already deconstructed
+                scrolledView notNil ifTrue:[
+                    lockUpdates := true.
+                    scrolledView scrollHorizontalToPercent:position.
+                    lockUpdates := false
+                ].
+            ].
+
+        hScrollBar scrollUpAction:
+            [   
+                |sensor|
+
+                "/ in case the event came after the view was already deconstructed
+                scrolledView notNil ifTrue:[
+                    sensor := self sensor.
+                    (sensor shiftDown or:[sensor ctrlDown]) ifTrue:[
+                        scrolledView scrollToLeft
+                    ] ifFalse:[
+                        scrolledView scrollLeft
+                    ]
+                ].
+            ].
+
+        hScrollBar scrollDownAction:
+            [
+                |sensor|
+
+                "/ in case the event came after the view was already deconstructed
+                scrolledView notNil ifTrue:[
+                    sensor := self sensor.
+                    (sensor shiftDown or:[sensor ctrlDown]) ifTrue:[
+                        scrolledView scrollToRight
+                    ] ifFalse:[
+                        scrolledView scrollRight
+                    ]
+                ].
+            ].
     ].
 
     scrolledView addDependent:self.