是否可以在类的成员方法中引用当前对象。请考虑以下代码:
itcl::class widget {
private variable inst
method ChildCount {} {
return [llength [keylkeys inst children]]
}
method AddChild {childWidget} {
inst children.[ChildCount] $childWidget
# ***HOW TO GET THIS WORKING?***
$childWidget SetParent $self
}
}
$self
in的等价物是$childWidget SetParent $self
什么?