redraw twice in case of expose event during adding a new entry
authorca
Sat, 03 Jan 1998 18:30:43 +0100
changeset 645 53c78cc2ee08
parent 644 5472db50a5eb
child 646 4cbd9dd64372
redraw twice in case of expose event during adding a new entry
DSVColumnView.st
--- a/DSVColumnView.st	Sat Jan 03 18:03:36 1998 +0100
+++ b/DSVColumnView.st	Sat Jan 03 18:30:43 1998 +0100
@@ -465,7 +465,7 @@
 
     aList size ~~ 0 ifTrue:[
         list := OrderedCollection new:(aList size).
-        list replaceFrom:1 to:(list size) with:aList startingAt:1.
+        aList do:[:el| list add:el ].
         beDependentOfRows ifTrue:[self beDependentOfRows:true].
     ] ifFalse:[
         list := nil
@@ -668,11 +668,6 @@
     ].
 
     list add:aRow beforeIndex:aRowNr.
-
-    list size == 1 ifTrue:[
-        self invalidate.
-      ^ aRow
-    ].
     self recomputeHeightOfContents.
 
     (y0 := self numberOfSelections) ~~ 0 ifTrue:[
@@ -689,6 +684,7 @@
             self deselect
         ]
     ].
+
     y0 := (aRowNr - 1) * rowHeight.
 
     y0 < viewOrigin y ifTrue:[
@@ -696,6 +692,7 @@
         viewOrigin y:(rowHeight + viewOrigin y).
         self originChanged:(0 @ rowHeight).        
     ].
+
     shown ifTrue:[
         y0 := self yVisibleOfRowNr:aRowNr.
         y1 := y0 + rowHeight.
@@ -704,14 +701,16 @@
             h  := h - y1.
             y0 := y0 max:margin.
             dH := y1 - y0.
-            self catchExpose.
-
-            self copyFrom:self x:0 y:y0
-                             toX:0 y:y1
-                           width:width height:h async:true.
-
+            aRowNr == list size ifFalse:[
+                self catchExpose.
+
+                self copyFrom:self x:0 y:y0
+                                 toX:0 y:y1
+                               width:width height:h async:true.
+
+                self waitForExpose
+            ].
             self redrawX:margin y:y0 width:width - margin - margin height:dH.
-            self waitForExpose.
         ]
     ].
     sizeOfListChanged := true.
@@ -1461,7 +1460,6 @@
     self  recomputeHeightOfContents.
     super realize.
     self  fitColumns.
-
 ! !
 
 !DSVColumnView methodsFor:'obsolete'!
@@ -2239,5 +2237,5 @@
 !DSVColumnView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.18 1998-01-03 17:02:59 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.19 1998-01-03 17:30:43 ca Exp $'
 ! !