Here is a small script, which creates a (nonsense) widget that is derived from ::itk::Toplevel. In Itk3.4 (for ::tcl_version <= 8.5) this used to work, but in itk4.0.0 (for ::tcl_version >= 8.6) it doesn't.
if {$tcl_version <= 8.5} { package require Itk 3.4 } else { package require itk 4.0.0 } namespace import ::itcl::* namespace import ::itk::* class Test { inherit itk::Toplevel constructor {args} { eval itk_initialize $args } } Test .t
When I run the script with tclsh8.6, I get the following error:
cannot inherit from "itk::Toplevel" (can't create object "itk::Toplevel": command already exists with that nameITCL: cannot create Tcl_NewObjectInstance for class "::itk::Toplevel") while executing "inherit itk::Toplevel" (class "Test" body line 2) invoked from within "class Test { inherit itk::Toplevel constructor {args} { eval itk_initialize $args } }" (file "tt.tcl" line 5)
What is wrong here?
same problem as in # 182