#REFACTORING
authorStefan Vogel <sv@exept.de>
Mon, 08 Feb 2016 14:00:05 +0100
changeset 7132 2cbd7562cfc8
parent 7131 42d5af0d9bd3
child 7133 56c7a7be25cd
#REFACTORING class: SimpleView comment/format in: #mapped changed: #openModal:inGroup: #visibilityChange: #waitUntilVisible
SimpleView.st
--- a/SimpleView.st	Mon Feb 08 13:59:11 2016 +0100
+++ b/SimpleView.st	Mon Feb 08 14:00:05 2016 +0100
@@ -6385,9 +6385,9 @@
 
         "/ tell my subViews ...
         subViews notNil ifTrue:[
-            subViews do:[:v | v  mapped
+            subViews do:[:v | 
 "/                v shown ifFalse:[
-"/                    v  mapped
+                    v  mapped.
 "/                ]
             ]
         ].
@@ -6681,17 +6681,12 @@
      action - i.e. window manager rearranged things).
      Using this knowledge avoids useless redraw in obscured views."
 
-    |shownBefore|
-
-    shownBefore := shown.
-
-    how == #fullyObscured ifTrue:[
-	shown := false
-    ] ifFalse:[
-	shown := true.
-    ].
-    shownBefore ~~ shown ifTrue:[
-	self changed:#visibility.
+    |newShown|
+
+    newShown := how ~~ #fullyObscured.
+    newShown ~~ shown ifTrue:[
+        shown := newShown.
+        self changed:#visibility.
     ].
 !
 
@@ -11327,7 +11322,7 @@
                 aWindowGroup notNil ifTrue:[
                     aWindowGroup graphicsDevice sync.  "thats a round trip - make sure that all drawing has been processed"
                     "/ ensure that eventListener runs here ...
-                    Delay waitForSeconds:0.05.
+                    Delay waitForMilliseconds:50.
                     aWindowGroup processExposeEvents.
 
                     (self isPopUpView or:[ ReturnFocusWhenClosingModalBoxes ]) ifTrue:[
@@ -11536,45 +11531,45 @@
      another view (which is only available once visible),
      use this to suspend the current process until the receiver is shown.
      Caveat:
-	we poll here for the view to be shown - we need a semaphore
-	which is raised by the view in order to do it right."
+        we poll here for the view to be shown - we need a semaphore
+        which is raised by the view in order to do it right."
 
     |wg n|
 
     n := 0.
     [self shown] whileFalse:[
-	(self graphicsDevice notNil and:[self graphicsDevice isOpen not]) ifTrue:[^ self].
-
-	"/ this was added to avoid a deadlock, when called from within
-	"/ the event dispatch process (as when doing foo inspect there).
-	n > (10 / 0.05) ifTrue:[
-	    'SimpleView [info]: View not visible after 10 seconds - will not wait any longer in waitUntilVisible' infoPrintCR.
-	    ^ self
-	].
-	n := n + 1.
-	Delay waitForSeconds:0.05.
-	(wg := self windowGroup) notNil ifTrue:[
-	    wg processExposeEvents.
-	].
+        (self graphicsDevice notNil and:[self graphicsDevice isOpen not]) ifTrue:[^ self].
+
+        "/ this was added to avoid a deadlock, when called from within
+        "/ the event dispatch process (as when doing foo inspect there).
+        n > (10 / 0.05) ifTrue:[
+            'SimpleView [info]: View not visible after 10 seconds - will not wait any longer in waitUntilVisible' infoPrintCR.
+            ^ self
+        ].
+        n := n + 1.
+        Delay waitForMilliseconds:50.
+        (wg := self windowGroup) notNil ifTrue:[
+            wg processExposeEvents.
+        ].
     ].
 
     "does not work (the view is in its opening phase,
      when we attempt to draw a line - this gives an error, since
      its internals are not yet correctly setup):
 
-	|v|
-
-	v := View new open.
-	v displayLineFrom:0@0 to:50@50
+        |v|
+
+        v := View new open.
+        v displayLineFrom:0@0 to:50@50
 
      does work (since we wait until the view has completely finished
      its startup phase):
 
-	|v|
-
-	v := View new open.
-	v waitUntilVisible.
-	v displayLineFrom:0@0 to:50@50
+        |v|
+
+        v := View new open.
+        v waitUntilVisible.
+        v displayLineFrom:0@0 to:50@50
     "
 
     "Modified: / 08-08-2010 / 14:46:34 / cg"