Manfred Stelzhammer
2024-12-13 08:42:41 UTC
Reply
Permalink#####script start
nx::Class create myClass -superclass nx::Class {
:object property "nix default"
:method init {} {
:property "nix [[:info class] cget -nix]"
}
}
myClass copy myClass2
myClass2 create Class2 {
:property "nix [[:info class] cget -nix]"
}
Class2 create obj2
puts "nix = [obj2 cget -nix]"
##### end
This script run like expected.
I get "nix = default"
If I add:
#### add
myClass copy myClass3
myClass3 configure -nix "nixclass3"
myClass3 create Class3 {
:property "nix [[:info class] cget -nix]"
}
Class3 create obj3
puts "nix = [obj3 cget -nix] "
#### add end
I get an error "Class3: unable to dispatch method 'property'"
####workaround
myClass configure -nix "nixclass3"
myClass copy myClass3
myClass3 create Class3 {
:property "nix [[:info class] cget -nix]"
}
Class3 create obj3
puts "nix = [obj3 cget -nix] "
#### workaround end
Now I get "nix = nixclass3"
If I configure "-nix" in the baseclass "myClass" and copy this class it
works.
If I copy the baseclass "myClass" and configure "-nix" I get an error.
Is this a normal behavior?
regards
Manfred