TIP 441: Add -justify Configuration Option to the listbox Widget

Login
Author:         François Vogel <[email protected]>
Author:         François Vogel <[email protected]>
State:          Final
Type:           Project
Vote:           Done
Created:        18-Jan-2016
Post-History:   
Keywords:       Tk,listbox
Tcl-Version:    8.6.5
Tk-Branch:      tip-441

Abstract

Despite the listbox widget already having numerous configuration options, some users need more refinements and have requested the possibility to control the justification of the text displayed in the items of the listbox. This TIP proposes to add this option.

Rationale

Currently the listbox widget always aligns its items leftwards. Some users miss a configuration options allowing to justify items in the listbox widget. These RFE include:

Proposed Change

It is proposed to add the -justify configuration option to the Tk listbox widget.

Possible values are as already documented in the options manual page (i.e., left, center, or right), and translate internally into standard Tk_Justify values, i.e., TK_JUSTIFY_LEFT, TK_JUSTIFY_CENTER, and TK_JUSTIFY_RIGHT, respectively.

Default value is left on all platforms, for backwards compatibility reasons.

Reference Implementation

A reference implementation is available in branch tip-441 of the fossil repository.

Copyright

This document has been placed in the public domain.