diff options
author | fvogelnew1@free.fr <fvogel> | 2016-01-16 14:03:32 (GMT) |
---|---|---|
committer | fvogelnew1@free.fr <fvogel> | 2016-01-16 14:03:32 (GMT) |
commit | 3cdb0c9d4ad134b17a904e49139d06541118a4ce (patch) | |
tree | 56fe0db9c6985d054dd2fe8776699345a2d557d0 /generic | |
parent | 46c7eebf9a3553ca1e3809764ce886a5bb1d56ae (diff) | |
download | tk-3cdb0c9d4ad134b17a904e49139d06541118a4ce.zip tk-3cdb0c9d4ad134b17a904e49139d06541118a4ce.tar.gz tk-3cdb0c9d4ad134b17a904e49139d06541118a4ce.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')
-rw-r--r-- | generic/tkListbox.c | 4 |
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) { |