keep scroll-offset when removing a key
authorClaus Gittinger <cg@exept.de>
Sat, 26 Jun 1999 17:49:18 +0200
changeset 2212 10903bf15c4b
parent 2211 9d7b89b3525d
child 2213 d6e6c41db3ef
keep scroll-offset when removing a key
DictInspV.st
DictionaryInspectorView.st
--- a/DictInspV.st	Sat Jun 26 17:44:48 1999 +0200
+++ b/DictInspV.st	Sat Jun 26 17:49:18 1999 +0200
@@ -154,7 +154,7 @@
 doRemoveKey
     "remove selected item from keys"
 
-    |idx key|
+    |idx key l|
 
     idx := self keyIndexForLine:selectedLine.
     idx notNil ifTrue:[
@@ -166,7 +166,9 @@
             selectedLine := nil.
             inspectedObject changed.
             listView cursor:(Cursor hand).
+            l := listView firstLineShown.
             self reinspect. "force list update"
+            listView scrollToLine:l.
         ].
     ]
 !
@@ -292,5 +294,5 @@
 !DictionaryInspectorView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Attic/DictInspV.st,v 1.36 1999-06-23 16:39:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Attic/DictInspV.st,v 1.37 1999-06-26 15:49:18 cg Exp $'
 ! !
--- a/DictionaryInspectorView.st	Sat Jun 26 17:44:48 1999 +0200
+++ b/DictionaryInspectorView.st	Sat Jun 26 17:49:18 1999 +0200
@@ -154,7 +154,7 @@
 doRemoveKey
     "remove selected item from keys"
 
-    |idx key|
+    |idx key l|
 
     idx := self keyIndexForLine:selectedLine.
     idx notNil ifTrue:[
@@ -166,7 +166,9 @@
             selectedLine := nil.
             inspectedObject changed.
             listView cursor:(Cursor hand).
+            l := listView firstLineShown.
             self reinspect. "force list update"
+            listView scrollToLine:l.
         ].
     ]
 !
@@ -292,5 +294,5 @@
 !DictionaryInspectorView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/DictionaryInspectorView.st,v 1.36 1999-06-23 16:39:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DictionaryInspectorView.st,v 1.37 1999-06-26 15:49:18 cg Exp $'
 ! !