summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogelnew1@free.fr <fvogel>2016-01-16 14:03:32 (GMT)
committerfvogelnew1@free.fr <fvogel>2016-01-16 14:03:32 (GMT)
commit72e487eaf28cee87212b5e5b4a4a01ae31101d4c (patch)
tree56fe0db9c6985d054dd2fe8776699345a2d557d0
parentc49afc18f0ed5c60f426e5a53c12d9e5a5c3a05f (diff)
downloadtk-72e487eaf28cee87212b5e5b4a4a01ae31101d4c.zip
tk-72e487eaf28cee87212b5e5b4a4a01ae31101d4c.tar.gz
tk-72e487eaf28cee87212b5e5b4a4a01ae31101d4c.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.
-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) {