A itcl question for variable

From: guan sy (guan.shangyuan51_at_zte.com.cn)
Date: 11/28/03


Date: 28 Nov 2003 00:44:42 -0800

hello:
      I use itcl to program a class. But when i run it , the tcl
interpretor shows some problems. The following is my exmaple. if you
know, please tell me what to notice especially.

file cat.ith:
class cat {
  public {
  method Constructor {type args} {}
  method Destructor {} {}
  method GetType {}
  method GetOther {}
  }
  private {
  variable cattype
  variable attributes
 }
}
file cat.itb
body cat::Constructor {type args} {
  set cattype $type
  set attributes $args
}
body cat::GetType {} {
return $cattype
}
body cat::GetOther {} {
return $attributes
}
file: mytest.tcl
...
cat x italycat white 20
set type [x GetType]

run it : no such variable $cattype