From: amnesiacx Date: 2004-01-09T21:21:49+09:00 Subject: Re: Call method from a TK object On Fri, 9 Jan 2004 20:30:29 +0900, ts wrote: >>>>>> "a" == amnesiacx writes: > >a> $start = TkButton.new { > > TkButton::new use #instance_eval, this mean that in the the block self is > $start > >a> text 'Start' >a> command proc { >a> $stop.text "Stop" >a> if @@stopped >a> @@stopped = FALSE >a> tick > > ruby try to call self.tick i.e. TkButton#tick and not StopWatch#tick, this > is why it give an error > >a> $stop = TkButton.new { >a> text 'Stop' >a> command proc{ >a> text "Zero" >a> if @@stopped then >a> zero > > same here, it try to call TkButton#zero and not StopWatch#zero > >a> text 'Stop' >a> end >a> @@stopped = TRUE >a> } > > > >Guy Decoux > Nope, calling StopWatch.tick or StopWatch.zero doesnt work, "no such method" (sic) error