Check-in [ad2ce4f845]

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:Updated TIP #496 (-placeholder option) according to recent discussions on tcl-core
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ad2ce4f8454c59e88289b76ce03211004d2933f8a94c7d93992bca45db8442c2
User & Date: fvogel 2018-03-05 22:30:12
Context
2018-03-08
14:19
Split out the discussion. check-in: 0b38fa0683 user: dkf tags: trunk
2018-03-05
22:30
Updated TIP #496 (-placeholder option) according to recent discussions on tcl-core check-in: ad2ce4f845 user: fvogel tags: trunk
19:27
formatting check-in: 2010e9a1db user: dgp tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to index.json.

cannot compute difference between binary files

Changes to index.md.

120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<td valign='top'># TIP 497: Full support for Unicode 10.0 and later (part 2)</td>
</tr>
<tr class='project projectdraft projectdraft87 project87'>
<td valign='top'><a href='./tip/496.md'>496</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
<td valign='top'># TIP 496: Display hints in ::entry ::ttk::entry ::ttk::spinbox and ::ttk::combobox</td>
</tr>
<tr class='project projectdraft projectdraft87 project87'>
<td valign='top'><a href='./tip/495.md'>495</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
<td valign='top'># TIP 495: Tcl Based Build System for TEA projects</td>






|







120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<td valign='top'># TIP 497: Full support for Unicode 10.0 and later (part 2)</td>
</tr>
<tr class='project projectdraft projectdraft87 project87'>
<td valign='top'><a href='./tip/496.md'>496</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
<td valign='top'># TIP 496: Display hints in ::entry ::spinbox ::ttk::entry ::ttk::spinbox and ::ttk::combobox</td>
</tr>
<tr class='project projectdraft projectdraft87 project87'>
<td valign='top'><a href='./tip/495.md'>495</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
<td valign='top'># TIP 495: Tcl Based Build System for TEA projects</td>

Changes to tip/496.md.

1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20
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
48
49
50
51
52
53
54
55
56
57
58
59
# TIP 496: Display hints in ::entry ::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
................................................................................

# Abstract

Entry fields should support the ability to display informational text when no text is given.

# Rationale

Entry fields, p.e. search boxes in browsers, have the ability to display some help text inside if no real value is given.
The text is with a lighter color and is removed if the user enters some real text.

The **entry** and **ttk::entry ttk::spinbox ttk::combobox** commands can easily 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** and **ttk::entry ttk::spinbox 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 **entry** and a style option for **ttk::entry**.

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 left justification.

# Discussion

- The naming of the options follows the naming on windows and macos.

- The default value for the -placeholderforeground option needs to be specified?

- Are -placeholderfont and -placeholderjustify options necessary?

# Implementation

A patch implementing these changes and updating the documentation is available.

The patch is in the fossil repository in the tip-496 branch.

# Example of use

	    package require Tk
	    # tk entry
	    grid [::ttk::entry .e];#normal display
	    .e configure -placeholder test;#display text is: test
|







 







|


<
|
<



|




|





|
<
<
<
<
<
<
<
<



|

|







1
2
3
4
5
6
7
8
..
11
12
13
14
15
16
17
18
19
20

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
48
49
# 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
................................................................................

# Abstract

Entry fields should support the ability to display informational text when no text is given.

# Rationale

Entry fields, for instance search boxes in browsers, have the ability to display some help text inside if no real value is given.
The text is with a lighter color and is removed if the user enters some real text.


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
	    grid [::ttk::entry .e];#normal display
	    .e configure -placeholder test;#display text is: test