Check-in [a0deeefbe4]

Login

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

Overview
Comment:New tip 496 added.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a0deeefbe474ca8cb9e4c375da93d3ddfdb6f2356eb952e10dd5c2018b2143df
User & Date: rene 2018-01-17 20:43:14
Context
2018-01-17
20:45
Replaced tip number in text. check-in: 034390c9a6 user: rene tags: trunk
20:43
New tip 496 added. check-in: a0deeefbe4 user: rene tags: trunk
2018-01-16
14:52
tip490 oo for msgcat: documented use-case: msgcat call within class definition script check-in: 09d678a2f8 user: oehhar tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to index.json.

cannot compute difference between binary files

Changes to index.md.

66
67
68
69
70
71
72







73
74
75
76
77
78
79
<th>#</th>
<th>Type</th>
<th>Tcl Version</th>
<th>Status</th>
<th>Title</th>
</tr></thead><tbody>








<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>
</tr>







>
>
>
>
>
>
>







66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<th>#</th>
<th>Type</th>
<th>Tcl Version</th>
<th>Status</th>
<th>Title</th>
</tr></thead><tbody>

<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 xxx: Display hints in ::ttk::entry</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>
</tr>

Added tip/496.md.







































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
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
60
61
62
63
64
65
66
67
# TIP xxx: Display hints in ::ttk::entry
	Author:         RenĂ© Zaumseil <[email protected]>
	State:          Draft
	Type:           Project
	Vote:           Pending
	Created:        17-Jan-2018
	Post-History:   
	Keywords:       Tk
	Tcl-Version:    8.7
-----

# 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**command 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** widgets if no text is otherwise displayed.
To control the text appearance the following new options will be added:

 -emptytext: The string to display.

 -emptyforeground: The color of the text.

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

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

The -emptytext value is always displayed with current font and left justification.

# Discussion

- The naming of the options should start with a common prefix. This prefix can be changed from empty to p.e. help.

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

- Are -emptyfont and -emptyjustify options necessary?

# Implementation

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

The patch should go in the fossil repository in the tip-xxx branch.

# Example of use

	    package require Tk
	    grid [::ttk::entry .e];#normal display
	    .e configure -emptytext test;#display text is: test
	    .e configure -emptybackground red;#display text is now red
	    .e insert end xxx;#display text is xxx, color is black
	    .e configure -textvariable a; set a yyy;##display text is yyy
	    set a {};#display text is test, color is red

# Copyright

This document has been placed in the public domain.