SelectionInTreeView.st
changeset 585 5a0ed2305998
parent 569 2a1014d6697c
child 589 979ea44d23ae
--- a/SelectionInTreeView.st	Wed Oct 29 08:42:29 1997 +0100
+++ b/SelectionInTreeView.st	Wed Oct 29 09:25:29 1997 +0100
@@ -384,6 +384,11 @@
         ^ self selectionFromModel
     ].
 
+    aModel == aModel ifTrue:[
+        something == #list ifTrue:[
+            ^ self getListFromModel
+        ]
+    ].
     ^ super update:something with:aParameter from:aModel.
 
 
@@ -816,12 +821,12 @@
     "
     |root|
 
-    root := rootHolder value.
+    root := rootHolder root.
 
     self root == root ifFalse:[
         self selection:nil.
         self root:root.
-    ]
+    ].
 !
 
 selectionFromModel
@@ -885,6 +890,9 @@
 !SelectionInTreeView methodsFor:'private'!
 
 list:aList keepSelection:keepSelection
+    "setup new list; keep selection dependent on the boolean state
+     keepSelection
+    "
     |list|
 
     list := aList.
@@ -902,6 +910,9 @@
 !
 
 nodeAt:anIndex expand:doExpand
+    "expand or collapse the node at an index, anIndex dependent on the boolean state
+     of doExpand
+    "
     |node|
 
     node := listOfNodes at:anIndex.
@@ -920,7 +931,9 @@
             self redrawLine:anIndex.
         ] ifFalse:[
             "/ with children; update list and redraw to end.
-            model updateList.
+            model removeDependent:self.
+            model recomputeList.
+            model addDependent:self.
             list := self listFromModel.
             self redrawFromLine:anIndex.
             self contentsChanged.
@@ -1121,7 +1134,9 @@
     ].
 
     rdwNd notNil ifTrue:[
-        model updateList.
+        model removeDependent:self.
+        model recomputeList.
+        model addDependent:self.
         list := self listFromModel.
         self redrawFromLine:(self indexOfNode:rdwNd).
         self contentsChanged.
@@ -1285,7 +1300,9 @@
                 self redrawLine:index.
             ] ifFalse:[
                 "/ with children; update list and redraw to end.
-                model updateList.
+                model removeDependent:self.
+                model recomputeList.
+                model addDependent:self.
                 list := self listFromModel.
                 self redrawFromLine:index.
                 self contentsChanged.
@@ -1305,5 +1322,5 @@
 !SelectionInTreeView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTreeView.st,v 1.28 1997-10-22 13:25:22 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTreeView.st,v 1.29 1997-10-29 08:25:02 ca Exp $'
 ! !