Tk Source Code

View Ticket
Login
2018-02-18
21:23 Closed ticket [2975142fff]: tk::CheckEnter broken with itcl variables plus 9 other changes artifact: 452120bb17 user: fvogel
2010-03-23
18:05 Add attachment button.tcl.patch to ticket [2975142fff] artifact: 4904f86492 user: ralfixx
18:05 Ticket [2975142fff] tk::CheckEnter broken with itcl variables status still Open with 4 other changes artifact: b3001eb8ac user: ralfixx
11:05 New ticket [2975142fff]. artifact: 662f21e2f8 user: ralfixx

Ticket UUID: 2975142
Title: tk::CheckEnter broken with itcl variables
Type: Bug Version: obsolete: 8.5.8
Submitter: ralfixx Created on: 2010-03-23 11:05:10
Subsystem: 03. [*button] and [label] Assigned To: fvogel
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2018-02-18 21:23:04
Resolution: Fixed Closed By: fvogel
    Closed on: 2018-02-18 21:23:04
Description:
# Tk 8.5.8 with Itcl on Linux (does not happen in 8.5.5).
# Error when a *itcl* variable is used as -variable for checkbutton.
# tk::CheckEnter assumes it can access the variable in global scope by prefixing it with "::"
# This is wrong for variables in itcl-namespaces:

wm geometry {.} 100x100
package require Itcl

itcl::class testclass {
    private variable foobar 1
    constructor {} {
pack [checkbutton .c -indicatoron false -variable [itcl::scope foobar]] -fill x
    }
}

testclass #auto

# Move mouse over checkbutton:
# can't read "::@itcl ::testclass0 ::testclass::foobar": no such variable
# can't read "::@itcl ::testclass0 ::testclass::foobar": no such variable
#     while executing
# "set ::[$w cget -variable]"
#     (procedure "tk::CheckEnter" line 26)
#     invoked from within
# "tk::CheckEnter .c"
#     (command bound to event)

# proposed patch: use uplevel instead of ::, see attached patch
User Comments: fvogel added on 2018-02-18 21:23:04:

This has been fixed a long time ago, see [528a087ed8].

I cannot reproduce with 8.5.16.

See also [2904708fff] and [2904492fff].


ralfixx added on 2010-03-23 18:05:11:

File Added - 367851: button.tcl.patch

Attachments: