SimpleView.st
changeset 8207 2d2335976051
parent 8206 bffa06a7b06d
child 8217 ed76c62a1bd2
--- a/SimpleView.st	Sat Oct 21 23:15:49 2017 +0200
+++ b/SimpleView.st	Sat Oct 21 23:35:45 2017 +0200
@@ -10500,7 +10500,7 @@
 
     shown ifFalse:[^ self]. 
 
-    self fill:flashColor.
+    self fill:(flashColor ? self blackColor).
     messageOrNil notNil ifTrue:[
         gc withForeground:self whiteColor do:[
             self displayString:messageOrNil centeredAt:(self center).
@@ -10531,8 +10531,7 @@
      v destroy
     "
 
-    "Modified: / 16-07-1998 / 18:46:48 / cg"
-    "Modified (comment): / 21-10-2017 / 23:13:58 / cg"
+    "Modified: / 21-10-2017 / 23:21:34 / cg"
 !
 
 flashReadOnly
@@ -10541,6 +10540,39 @@
     self flash:(resources string:'Read Only')
 !
 
+flashRectangle:rect withColor:flashColor
+    "flash part of the view - fill it flashColor, then white, 
+     finally redraw.
+     Can be used to bring attention to some line/part of view"
+
+    shown ifFalse:[^ self]. 
+
+    self fillRectangle:rect color:(flashColor ? self blackColor).
+
+    Delay waitForSeconds:0.1.
+    shown ifFalse:[^ self]. 
+    
+    self fillRectangle:rect color:self whiteColor.
+
+    Delay waitForSeconds:0.1.
+    shown ifFalse:[^ self]. 
+
+    self fillRectangle:rect color:viewBackground.
+    self invalidate:rect
+
+    "
+     |v|
+
+     v := View new openAndWait.
+     Delay waitForSeconds:2.
+     v flash:'Hello World' withColor:Color red.
+     Delay waitForSeconds:2.
+     v destroy
+    "
+
+    "Created: / 21-10-2017 / 23:21:20 / cg"
+!
+
 invalidate
     "add a damage to redraw the receiver to its input event queue.
      This is preferable to calling redraw directly, in that the drawing is done by