summaryrefslogtreecommitdiffstats
path: root/generic/tkListbox.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-01-16 14:03:32 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-01-16 14:03:32 (GMT)
commitcc44a614a3a33b8007a980a64270832c67c629f2 (patch)
tree56fe0db9c6985d054dd2fe8776699345a2d557d0 /generic/tkListbox.c
parent48ae923fc9c18de0e45d927b819cc756b6833aba (diff)
downloadtk-cc44a614a3a33b8007a980a64270832c67c629f2.zip
tk-cc44a614a3a33b8007a980a64270832c67c629f2.tar.gz
tk-cc44a614a3a33b8007a980a64270832c67c629f2.tar.bz2
Addressed question 2 (see artifact [9d48a9c212] of ticket [3f456a5bb9]).
This code arranges for the correct xview when creating the listbox with non-default justification. It is correctly placed in Tk_ListboxObjCmd. When changing justification later, i.e. in ConfigureListbox, there is no reason to change the xview, it would not be desired that the listbox xview jumps when configuring -justify.
Diffstat (limited to 'generic/tkListbox.c')
-rw-r--r--generic/tkListbox.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index bea98ee..56e2c2f 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -581,6 +581,10 @@ Tk_ListboxObjCmd(
return TCL_ERROR;
}
+ /*
+ * Adjust startup x view according to the justify option.
+ */
+
if (listPtr->justify == TK_JUSTIFY_RIGHT) {
listPtr->xOffset = GetMaxOffset(listPtr);
} else if (listPtr->justify == TK_JUSTIFY_CENTER) {