WindowGroup.st
changeset 6343 5747b4dbc94b
parent 6147 19c3eddaa8e1
child 6364 47ed6ce16ea2
--- a/WindowGroup.st	Wed Mar 19 11:05:13 2014 +0100
+++ b/WindowGroup.st	Wed Mar 19 22:26:18 2014 +0100
@@ -2713,7 +2713,7 @@
      my views (used to show wait-cursor while doing something).
      Return the result as returned by aBlock."
 
-    |oldCursors dev deviceCursor action|
+    |oldCursors dev deviceCursor|
 
     dev := self graphicsDevice.   
     (dev isNil or:[aCursor isNil] or:[inWithCursorDoBlock == true]) ifTrue:[
@@ -2726,46 +2726,40 @@
      get mapping of view->cursor for all of my subviews
     "
     oldCursors := IdentityDictionary new.
-    self allViewsDo:[:aView |
+    self allViewsDo:[:eachView |
         |old|
 
-        old := aView cursor.
+        old := eachView cursor.
         old ~~ deviceCursor ifTrue:[
-            oldCursors at:aView put:old.
-            aView cursor:deviceCursor now:false
+            oldCursors at:eachView put:old.
+            eachView cursor:deviceCursor now:false
         ]
     ].
 
     oldCursors isEmpty ifTrue:[
-        action := aBlock
+        ^ aBlock value. 
     ] ifFalse:[
-        action := [
-            |rslt|
-
-            inWithCursorDoBlock := true.
-            "used to do a sync here to make the cursor visible,
-             but everything is so fast nowaday, that it doesn't make a difference"
-            dev flush.
-
-            rslt := aBlock ensure:[
+        "used to do a sync here to make the cursor visible,
+         but everything is so fast nowaday, that it doesn't make a difference"
+        dev flush.
+        inWithCursorDoBlock := true.
+        ^ aBlock ensure:[
                 "
                  restore cursors from the mapping
                 "
-                oldCursors keysAndValuesDo:[:view :cursor |
-                    view cursor:cursor now:false.
+                oldCursors keysAndValuesDo:[:eachView :eachCursor |
+                    eachView cursor:eachCursor now:false.
                 ].
                 dev flush.
                 inWithCursorDoBlock := false.
             ].
-            rslt
-          ]
     ].
 
 "/    (self isModal and:[previousGroup notNil]) ifTrue:[
 "/        "/ pass the work to my parentGroup
 "/        ^ previousGroup withCursor:aCursor do:action
 "/    ].
-    ^ action value.
+
 
     "Modified: / 22.4.1998 / 14:36:47 / cg"
 !
@@ -2813,11 +2807,11 @@
 !WindowGroup class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/WindowGroup.st,v 1.326 2013-10-28 11:40:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WindowGroup.st,v 1.327 2014-03-19 21:26:18 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/WindowGroup.st,v 1.326 2013-10-28 11:40:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WindowGroup.st,v 1.327 2014-03-19 21:26:18 stefan Exp $'
 ! !