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)
commitfc340b7494030742d3226cde3c19564c24894f68 (patch)
tree56fe0db9c6985d054dd2fe8776699345a2d557d0 /generic/tkListbox.c
parent8e83dc86bcd2713ac1a551cc8d2ca6df8fdfca79 (diff)
downloadtk-fc340b7494030742d3226cde3c19564c24894f68.zip
tk-fc340b7494030742d3226cde3c19564c24894f68.tar.gz
tk-fc340b7494030742d3226cde3c19564c24894f68.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) {