Tk Source Code

View Ticket
Login
Ticket UUID: 2421792
Title: Label with long text draws garbage
Type: Bug Version: obsolete: 8.4.19
Submitter: hanzl Created on: 2008-12-12 16:33:12
Subsystem: 65. Generic Window Operations Assigned To: fvogel
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2023-08-04 14:17:18
Resolution: Fixed Closed By: fvogel
    Closed on: 2023-08-04 14:17:18
Description:
Label with text exceeding certain limit draws text several times with different horizontal positions, resulting in garbage:

package require Tk
label .lab -text [string repeat "Abc" 16000]
pack .lab

On my system, repeat count 6000 is OK and 7000 and higher draws garbage.

Tested with 8.5.1 (latest tclkit I found for 32bit Linux) and 8.4.12.

Looking through existing bug reports, the closest match I found was [ 547593 ] Error creating Label > 32k pixels , which was closed years ago.
User Comments: fvogel added on 2023-08-04 14:17:18:

This was fixed by pspjuth for Windows, see ticket [140ea8ab38] and the fix [44e27f3e]. One can reproduce the problem (nothing gets drawn) with core-8-6-branch by reverting that fix and running the provided test case (with a repeat count much higher, say 160000).

For Linux as well I cant reproduce, even with a repeat count of 1600000.


fvogel added on 2016-08-19 08:05:15:

Same issue for the entry widget: [1449858]


patthoyts added on 2010-01-05 16:48:13:
On Windows such a label does not draw anything (repro'd on 8.4.19 and 8.5.8)

patthoyts added on 2010-01-05 16:43:31:
Reproduced on 8.5.8 and 8.6 HEAD. The label appears to overwrite itself multiple times rather than clipping.
ttk::label clips properly.