Check-in [6896b0788d]

Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Documented in TIP #496 that -justify can only be honored if there is enough display space, and a bit of reformatting.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6896b0788d2ead6665a5197574417ce05170d3b592e41113f12af0ceec2a9759
User & Date: fvogel 2018-04-15 08:46:57.686
Context
2018-04-15
12:49
TIP #496 now in VOTING state check-in: 7ce98343a5 user: fvogel tags: trunk
08:46
Documented in TIP #496 that -justify can only be honored if there is enough display space, and a bit of reformatting. check-in: 6896b0788d user: fvogel tags: trunk
2018-04-11
13:00
Added clarification discussed on tcl-core and elsewhere. check-in: d037db9c8b user: dkf tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to index.json.

cannot compute difference between binary files

Changes to tip/496.md.
1
2

3
4
5
6
7
8
9
# TIP 496: Display hints in ::entry ::spinbox ::ttk::entry ::ttk::spinbox and ::ttk::combobox
	Author:         René Zaumseil <[email protected]>

	State:          Draft
	Type:           Project
	Vote:           Pending
	Created:        17-Jan-2018
	Post-History:   
	Keywords:       Tk
	Tcl-Version:    8.7


>







1
2
3
4
5
6
7
8
9
10
# TIP 496: Display hints in ::entry ::spinbox ::ttk::entry ::ttk::spinbox and ::ttk::combobox
	Author:         René Zaumseil <[email protected]>
	Author:         François Vogel <[email protected]>
	State:          Draft
	Type:           Project
	Vote:           Pending
	Created:        17-Jan-2018
	Post-History:   
	Keywords:       Tk
	Tcl-Version:    8.7
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
The **entry**,  **spinbox**, **ttk::entry**, **ttk::spinbox** and **ttk::combobox** commands can easily be enhanced to provide this support, and there is no interference with existing code as this functionality can be done by just introducing new options.

# Specification

A help text can be displayed on **entry**,  **spinbox**, **ttk::entry**, **ttk::spinbox** and **ttk::combobox** widgets if no text is otherwise displayed.
To control the text appearance the following new options will be added:

 -placeholder: The string to display.

 -placeholderforeground: The color of the text. This is a normal option for the Tk widgets and a style option for the Ttk widgets.

If the -placeholder text is empty (the default value) then nothing is displayed.

The -placeholderforeground has a default value of #b3b3b3 (gray70).

The -placeholder text value is always displayed with current font and justification.

# Implementation

A patch implementing these changes is available in the fossil repository in the tip-496 branch.


Documentation updates not yet done.

# Example of use

	    package require Tk
	    # tk entry







|

|
<
<
<
<
<
<



|
>







22
23
24
25
26
27
28
29
30
31






32
33
34
35
36
37
38
39
40
41
42
43
The **entry**,  **spinbox**, **ttk::entry**, **ttk::spinbox** and **ttk::combobox** commands can easily be enhanced to provide this support, and there is no interference with existing code as this functionality can be done by just introducing new options.

# Specification

A help text can be displayed on **entry**,  **spinbox**, **ttk::entry**, **ttk::spinbox** and **ttk::combobox** widgets if no text is otherwise displayed.
To control the text appearance the following new options will be added:

 **-placeholder**: The string to display. If empty (the default value) then nothing is displayed. This text value is always displayed with current font and justification. Note that justification can really be honored only if the available display space is large enough to contain the complete text value (this is anyway true also for the widget text itself, see [Tcl Core discussion] (http://code.activestate.com/lists/tcl-core/19657/)).

 **-placeholderforeground**: The color of the text. This is a normal option for the Tk widgets and a style option for the Ttk widgets. Default value is #b3b3b3 (gray70).







# Implementation

A patch implementing these changes is available in the fossil repository in the [tip-496 branch]
(https://core.tcl.tk/tk/timeline?r=tip-496).

Documentation updates not yet done.

# Example of use

	    package require Tk
	    # tk entry