Tk Source Code

View Ticket
Login
Ticket UUID: 707778
Title: canvas/scrollbar/text return wrong configure synonym info
Type: Bug Version: 8.4.2, 8.6.18, 9.0.5, 9.1b1
Submitter: markgsaye Created on: 2003-03-21 22:53:08
Subsystem: 18. [text] Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2026-09-22 09:16:27
Resolution: None Closed By: nobody
    Closed on:
Description:
Most widgets return configure information with synonyms
pointing to the associated configure option switch. The
canvas, scrollbar and text widgets return synonyms
pointing to the database name. e.g.

% button .b
.b
% join [lsort [.b configure]] \n
...
-background background Background #d9d9d9 #d9d9d9
-bd -borderwidth
-bg -background
-bitmap bitmap Bitmap {} {}
-borderwidth borderWidth BorderWidth 2 2
...
-fg -foreground
-foreground foreground Foreground Black Black
...

(Note how -bg maps to -background and -bd to -borderwidth)

% text .t
.t
% join [lsort [.t configure]] \n
...
-background background Background #d9d9d9 #d9d9d9
-bd borderWidth
-bg background
-borderwidth borderWidth BorderWidth 2 2
...
-fg foreground
-foreground foreground Foreground Black Black
...

(Here -bg maps to background and -bd to borderWidth}

In 8.3.5, the frame, message and toplevel widgets also
suffered from this bug, but appear fixed in 8.4.
User Comments: serhiy.storchaka added on 2026-09-22 09:16:27:

The text widget has reported the option name since it was converted to the new option system in Tk 8.5 ([e58248ce5f], TIP 155), but canvas and scrollbar still use Tk_ConfigureInfo(), which reports a synonym with the database name of the option it refers to ("borderWidth") instead of the option name ("-borderwidth").

Fixed in [03d1a43c33] (branch oldconfig-synonym-info): Tk_ConfigureInfo() now reports the name of the option, like Tk_GetOptionInfo(). As noted by aspect, the documentation of TK_CONFIG_SYNONYM was wrong about the dbName field: it holds the database name of the option (which is what all option tables and the lookup use), not its name; corrected. Tests canvas-1.45.1 and scrollbar-1.100.


fvogel added on 2019-01-18 22:01:27:

This was reported again in comp.lang.tcl.


aspect added on 2015-07-21 02:23:56:
More in tkOldConfig.c!  Since I was in here recently, here are some notes:


This appears to stem from a documentation:implementation mismatch in tkOldConfig.c that has existed since at least 1999:

http://core.tcl.tk/tk/artifact/e71fd7412b3dc34d?ln=339-341

.. suggests that TK_CONFIG_SYNONYM should be followed by an argvName in the dbName field, but ..

http://core.tcl.tk/tk/artifact/4c31292bd7cc7fea?ln=295-305

.. disagrees.  Formatting appears to be controlled here:

http://core.tcl.tk/tk/artifact/4c31292bd7cc7fea?ln=704-706


If this analysis is correct, I suspect the best approach is to correct the documentation and the formatting code;  FindConfigSpec can be left alone.