inherit $this

class aa {
 inherit itk::Widget
 public method kka
 constructor { args }  {
  puts $itk_component(hull)
  puts [ $this kkc]

# [code $this kkc]
 }
}
body aa::kka { args } {
 puts "aa"
}


class bb {

 
 inherit aa
# inherit itk::Widget
 public method kkb
 constructor { args } {
  puts $itk_component(hull)
  puts [ $this kkc]
 }
}
body bb::kkb { args } {
 puts "bb"
}

class cc {
 inherit bb
 public method kkc
 constructor { args } {
   eval bb::constructor $args
 } {
  puts $itk_component(hull)
  puts [ $this kkc]
 }
}
body cc::kkc { args } {
 puts "cc"
}

cc .c abt acd ad

inherit a class,  $this = $this in the inherit class

posted @ 2011-08-07 00:09  greencolor  阅读(151)  评论(0编辑  收藏  举报