DataSetView.st
changeset 759 e8b80b2237c6
parent 745 4070ba345f45
child 808 7ed2da8edd1c
--- a/DataSetView.st	Fri Feb 13 14:56:35 1998 +0100
+++ b/DataSetView.st	Fri Feb 13 14:57:35 1998 +0100
@@ -581,7 +581,7 @@
     chgObj == columnView ifTrue:[
         what == #selection ifTrue:[
             model notNil ifTrue:[
-                val := columnView selectedRowIndex.
+                val := columnView selectedRowIndex copy.
 
                 (model respondsTo:#selectionIndex:) ifTrue:[
                     model selectionIndex:val
@@ -608,7 +608,7 @@
 
     chgObj == model ifTrue:[
         (what == #selectionIndex or:[what == #selection]) ifTrue:[
-            ^ columnView selectRowIndex:(model selectionIndex)
+            ^ columnView selectRowIndex:(model selectionIndex copy)
         ].
         what == #list ifTrue:[
             ^ self listHolder:model list
@@ -638,19 +638,25 @@
 updateLabels
     "layout of labels changed; recompute layout
     "
-    |x0 x1 dX id lst|
+    |x0 x1 dX id lst noCols size|
+
+    size   := labels size.
+    noCols := columnView numberOfColumns.
 
-    labels size == columnView numberOfColumns ifFalse:[
+    size ~~ noCols ifTrue:[
+        noCols == 0 ifTrue:[
+            ^ self recomputeLabels
+        ].
         id := columnView lastColumn showColSeparator ifTrue:[0] ifFalse:[1].
 
         columnView columnsDo:[:aCol|
             aCol showColSeparator ifTrue:[id := id + 1]
         ].
-        labels size ~~ id ifTrue:[
+        size ~~ id ifTrue:[
             ^ self recomputeLabels
         ].
     ].
-    labels size == 0 ifTrue:[ ^ self ].
+    size == 0 ifTrue:[ ^ self ].
 
     x0  := columnView margin - columnView xOriginOfContents.
     dX  := columnView separatorSize - 1.
@@ -824,5 +830,5 @@
 !DataSetView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/DataSetView.st,v 1.15 1998-02-07 16:40:26 tz Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/DataSetView.st,v 1.16 1998-02-13 13:57:35 ca Exp $'
 ! !