diff options
Diffstat (limited to 'generic/tkListbox.c')
-rw-r--r-- | generic/tkListbox.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/generic/tkListbox.c b/generic/tkListbox.c index ced0620..50e7652 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkListbox.c,v 1.12 1999/11/24 00:20:13 ericm Exp $ + * RCS: @(#) $Id: tkListbox.c,v 1.13 1999/11/24 01:09:07 ericm Exp $ */ #include "tkPort.h" @@ -3195,6 +3195,12 @@ ListboxListVarProc(clientData, interp, name1, name2, flags) if (oldLength != listPtr->nElements) { listPtr->flags |= UPDATE_V_SCROLLBAR; + if (listPtr->topIndex > (listPtr->nElements - listPtr->fullLines)) { + listPtr->topIndex = listPtr->nElements - listPtr->fullLines; + if (listPtr->topIndex < 0) { + listPtr->topIndex = 0; + } + } } /* |