Tk Source Code

View Ticket
Login
Ticket UUID: f91aa24bbed4202de0a7375732708f8cb844edee
Title: Use of Tcl_Obj vs char * in Widget storage
Type: Bug Version: 8.6
Submitter: jan.nijtmans Created on: 2024-09-03 14:12:47
Subsystem: (unused) Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2024-10-31 10:09:56
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2024-10-31 10:09:56
Description:

Many widgets, like entry and listbox, use char * storage for option values. For example listVarName and selectMode (which still is defined as a a Tk_Uid, which - in reality - it is not)

The disadvantage of using char * is that values cannot be shared. Therefore, it's better to use Tcl_Obj * for such values.

Not important enough to rush into 9.0

User Comments: jan.nijtmans added on 2024-10-31 10:09:56:

Last part of fix committed [01a03b2f90192619|here].

This could be backported to Tk 8.7, but that can wait. No prio to do that now.


oehhar added on 2024-10-22 13:59:44:
Jan,
thank you for all the work here. When working on the image command, I never understood why there are strings. It was just forgotten, when the object interface was created.
Appriation,
Harald

jan.nijtmans added on 2024-09-09 12:58:53:

Proposed fix for "canvas" [73c4dc748b9bb9c0|here]

Since TkCanvas is an internal structure, we can change fields in it, but it's better not to do that in minor or patch releases. That's why it's better to make this change in Tk 9.0.0, even though it's not high prio.