Itk - the [incr Tk] extension

View Ticket
Login
Ticket Hash: 38744a21a04682faae1906b2ddc694515efd7c02
Title: 'cannot get context object' in itk::Widget configbody
Status: Closed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Resolution: Fixed
Last Modified: 2017-07-07 18:50:10
Version Found In: 4.1.0
User Comments:
dgp added on 2017-07-06 19:52:41:
itcl::class C {
    inherit itk::Widget

    itk_option define -bar bar Bar 2
    protected method foo {} {puts FOO}
    constructor args {
        itk_initialize {*}$args
    }
}
itcl::configbody C::bar {
    foo
}
C .c
.c configure -bar 2



FOO
Error in startup script: ItclObjectCmd cannot get context object (NULL)
    while executing
"foo"
    (while configuring option "-bar" for widget "::.c")
    invoked from within
".c configure -bar 2"
    (file "/home/dgp/pb.tcl" line 15)

dgp added on 2017-07-07 18:50:10:
Fixed by adapting Itcl 4.1's new itclObjMethodType to
copy some of the same shenanigans at work in procedure
methods.