add item at root
authorClaus Gittinger <cg@exept.de>
Wed, 31 Mar 1999 19:09:45 +0200
changeset 1304 e6693ac51d54
parent 1303 336dc062d8d8
child 1305 c8f2fe1fac85
add item at root
SelInTree.st
SelectionInTree.st
--- a/SelInTree.st	Wed Mar 31 18:27:25 1999 +0200
+++ b/SelInTree.st	Wed Mar 31 19:09:45 1999 +0200
@@ -341,14 +341,16 @@
         "/
         "/ parent not visible; list not changed
         "/
-        aParent add:something beforeIndex:anIndex.
-        ^ self
-    ].
-
-    aParent shown ifFalse:[
-        aParent add:something beforeIndex:anIndex.
-        self changed:#at: with:start.
-        ^ self
+        aParent == root ifFalse:[
+            aParent add:something beforeIndex:anIndex.
+          ^ self
+        ]
+    ] ifFalse:[
+        aParent shown ifFalse:[
+            aParent add:something beforeIndex:anIndex.
+            self changed:#at: with:start.
+            ^ self
+        ]
     ].
     children := aParent children.
 
@@ -893,5 +895,5 @@
 !SelectionInTree class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/Attic/SelInTree.st,v 1.26 1999-03-19 21:18:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/Attic/SelInTree.st,v 1.27 1999-03-31 17:09:45 cg Exp $'
 ! !
--- a/SelectionInTree.st	Wed Mar 31 18:27:25 1999 +0200
+++ b/SelectionInTree.st	Wed Mar 31 19:09:45 1999 +0200
@@ -341,14 +341,16 @@
         "/
         "/ parent not visible; list not changed
         "/
-        aParent add:something beforeIndex:anIndex.
-        ^ self
-    ].
-
-    aParent shown ifFalse:[
-        aParent add:something beforeIndex:anIndex.
-        self changed:#at: with:start.
-        ^ self
+        aParent == root ifFalse:[
+            aParent add:something beforeIndex:anIndex.
+          ^ self
+        ]
+    ] ifFalse:[
+        aParent shown ifFalse:[
+            aParent add:something beforeIndex:anIndex.
+            self changed:#at: with:start.
+            ^ self
+        ]
     ].
     children := aParent children.
 
@@ -893,5 +895,5 @@
 !SelectionInTree class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTree.st,v 1.26 1999-03-19 21:18:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTree.st,v 1.27 1999-03-31 17:09:45 cg Exp $'
 ! !