summaryrefslogtreecommitdiffstats
path: root/generic/tkListbox.c
diff options
context:
space:
mode:
authorfvogel <fvogel@noemail.net>2016-01-17 21:09:52 (GMT)
committerfvogel <fvogel@noemail.net>2016-01-17 21:09:52 (GMT)
commiteb58563ca259499c922b91d9991a247c7aadc34d (patch)
tree6b58593d95e59adea39c564cc2269c32da7f5abf /generic/tkListbox.c
parent9f99fe67da3bcf454873550983505a2c5cc8cc7c (diff)
downloadtk-eb58563ca259499c922b91d9991a247c7aadc34d.zip
tk-eb58563ca259499c922b91d9991a247c7aadc34d.tar.gz
tk-eb58563ca259499c922b91d9991a247c7aadc34d.tar.bz2
Addressed question 4 (see artifact [9d48a9c212] of ticket [3f456a5bb9]).
FossilOrigin-Name: ae788ecf965e471ad0d65a4b16f600b231e57e73
Diffstat (limited to 'generic/tkListbox.c')
-rw-r--r--generic/tkListbox.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index 9ff9d23..e29c637 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -3630,7 +3630,8 @@ MigrateHashEntries(
*
* GetMaxOffset --
*
- * Passing in a listbox pointer, returns the maximum offset for the box.
+ * Passing in a listbox pointer, returns the maximum offset for the box,
+ * i.e. the maximum possible horizontal scrolling value (in pixels).
*
* Results:
* Listbox's maxOffset.
@@ -3649,6 +3650,11 @@ static int GetMaxOffset(
(Tk_Width(listPtr->tkwin) - 2*listPtr->inset -
2*listPtr->selBorderWidth) + listPtr->xScrollUnit - 1;
if (maxOffset < 0) {
+
+ /*
+ * Listbox is larger in width than its largest width item.
+ */
+
maxOffset = 0;
}
maxOffset -= maxOffset % listPtr->xScrollUnit;