summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-01-17 21:09:52 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-01-17 21:09:52 (GMT)
commitf753eecfed15ad634f2a6b98c56a6cd1f0194beb (patch)
tree6b58593d95e59adea39c564cc2269c32da7f5abf /generic
parent61a97384456cdf43006536d3436fa51ee3e9acff (diff)
downloadtk-f753eecfed15ad634f2a6b98c56a6cd1f0194beb.zip
tk-f753eecfed15ad634f2a6b98c56a6cd1f0194beb.tar.gz
tk-f753eecfed15ad634f2a6b98c56a6cd1f0194beb.tar.bz2
Addressed question 4 (see artifact [9d48a9c212] of ticket [3f456a5bb9]).
Diffstat (limited to 'generic')
-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;