delay a second before grabbing screen image (to allow for redraws to happen)
authorClaus Gittinger <cg@exept.de>
Thu, 10 Sep 1998 16:51:59 +0200
changeset 990 4303f0064410
parent 989 180731831d8b
child 991 9454c462dad4
delay a second before grabbing screen image (to allow for redraws to happen)
ImageEditor.st
--- a/ImageEditor.st	Wed Sep 09 17:32:59 1998 +0200
+++ b/ImageEditor.st	Thu Sep 10 16:51:59 1998 +0200
@@ -2383,33 +2383,37 @@
 grabScreenImage
     "let user choose an area and grab that are for editing"
 
-    |image d8image img|
-
-    image := Image fromUser.
+    Processor 
+        addTimedBlock:[
+            |image d8image img|
 
-    image depth > 8 ifTrue:[
-        Object errorSignal handle:[:ex |
-            ex signal == Object haltSignal ifTrue:[ex reject].
-            ex signal == Signal noHandlerSignal ifTrue:[ex reject].
+            image := Image fromUser.
+
+            image depth > 8 ifTrue:[
+                Object errorSignal handle:[:ex |
+                    ex signal == Object haltSignal ifTrue:[ex reject].
+                    ex signal == Signal noHandlerSignal ifTrue:[ex reject].
 
-            self warn:'Could not convert to depth8 image (too many colors)'.
-            d8image := nil.
-        ] do:[
-            d8image := Depth8Image new.
-            d8image fromImage:image.
-        ].
-        d8image notNil ifTrue:[
-            image := d8image
-        ]
-    ].
-    (imageEditView image:image) notNil ifTrue:[
-        self listOfColors contents:(image colorMap).
-        self findColorMapMode.
-        self updateLabelsAndHistory.
-    ]
+                    self warn:'Could not convert to depth8 image (too many colors)'.
+                    d8image := nil.
+                ] do:[
+                    d8image := Depth8Image new.
+                    d8image fromImage:image.
+                ].
+                d8image notNil ifTrue:[
+                    image := d8image
+                ]
+            ].
+            (imageEditView image:image) notNil ifTrue:[
+                self listOfColors contents:(image colorMap).
+                self findColorMapMode.
+                self updateLabelsAndHistory.
+            ]
+                      ] 
+        afterSeconds:1
 
     "Created: / 29.7.1998 / 21:24:42 / cg"
-    "Modified: / 31.7.1998 / 01:14:33 / cg"
+    "Modified: / 10.9.1998 / 16:01:23 / cg"
 ! !
 
 !ImageEditor methodsFor:'user actions - saving'!