Tk Library Source Code

View Ticket
Login
Ticket UUID: e5337a28466fb6cd9310e14d125fa89272a41ae4
Title: ttk::entry shows an artifact in placeholder text in some situations
Type: Bug Version: 9.0.3; 9.1a1
Submitter: m.n.summerfield Created on: 2026-02-27 09:37:06
Subsystem: widget Assigned To: aku
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-03-13 11:58:31
Resolution: Fixed Closed By: oehhar
    Closed on: 2026-03-13 11:58:31
Description:

This program shows the bug:

tk scaling 2
ttk::entry .e1 -placeholder "It is this"
ttk::entry .e2 -placeholder "It’s this"
grid .e1 -row 0 -column 0
grid .e2 -row 1 -column 0
bind . <Escape> exit
If you run the program the first entry correctly shows It is this but the second entry wrongly shows It’s this?n, where the ? is a box. If you vary the text (but include the apostrophe, ’, different numbers of boxes or n's appear.

User Comments: oehhar added on 2026-03-13 11:58:31:

Fixed in tk. Closing. Thanks for all, Harald


oehhar added on 2026-02-27 13:14:53:

Great ! Reported in plain Tk here: https://core.tcl-lang.org/tk/info/992d6f113541d287

Harald


anonymous added on 2026-02-27 12:50:13:
Good catch, but a Tk bug regarding strlen() vs. Tcl_GetCharLength()
in computing the placeholder's length for text layout, see POC fix in:

https://androwish.org/home/info/54d2f6b404211874

Please add this ticket to the Tk repo.