# HG changeset patch # User Claus Gittinger # Date 1372341282 -7200 # Node ID 663a43a31111904d810b4e9979e1fee5329d6fca # Parent d81164de732d191585555b1109fda794235ec692 class: ListView comment/format in: #contentsChanged diff -r d81164de732d -r 663a43a31111 ListView.st --- a/ListView.st Thu Jun 27 14:14:07 2013 +0200 +++ b/ListView.st Thu Jun 27 15:54:42 2013 +0200 @@ -2014,29 +2014,29 @@ !ListView methodsFor:'event handling'! contentsChanged - "contents changed - move origin up if possible" + "size of contents changed - move origin up if possible" |listSize newOrigin| shown ifTrue:[ - list notNil ifTrue:[ - listSize := self numberOfLines. - - listSize == 0 ifTrue:[ - widthOfWidestLine := 0. - ]. - - " - if we are beyond the end, scroll up a bit - " - ((firstLineShown + nFullLinesShown) > listSize) ifTrue:[ - newOrigin := listSize - nFullLinesShown + 1. - newOrigin < 1 ifTrue:[ - newOrigin := 1 - ]. - self scrollToLine: newOrigin. - ]. - ]. + list notNil ifTrue:[ + listSize := self numberOfLines. + + listSize == 0 ifTrue:[ + widthOfWidestLine := 0. + ]. + + " + if we are beyond the end, scroll up a bit + " + ((firstLineShown + nFullLinesShown) > listSize) ifTrue:[ + newOrigin := listSize - nFullLinesShown + 1. + newOrigin < 1 ifTrue:[ + newOrigin := 1 + ]. + self scrollToLine: newOrigin. + ]. + ]. ]. ^ super contentsChanged @@ -4899,10 +4899,10 @@ !ListView class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.367 2013-06-17 12:52:56 stefan Exp $' + ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.368 2013-06-27 13:54:42 cg Exp $' ! version_CVS - ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.367 2013-06-17 12:52:56 stefan Exp $' + ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.368 2013-06-27 13:54:42 cg Exp $' ! !