Chris Mcgrath
c_r_mcgra****@yahoo*****
Thu Jan 25 21:53:30 JST 2007
On 25 Jan 2007, at 12:33, Laurent Sansonetti wrote: > Hi Hisa-san, > > Your proposal is OK to me (I enjoy the block syntax :)). > > Just one though. I think that ib_action should accept 2 different > usages. > > First, > > ib_action :buttonPressed { |sender| ... } > > Second, > > ib_action :buttonPressed > # Assuming #buttonPressed is defined elsewhere > > My concern is that people already wrote RubyCocoa code (and so, IB > actions as Ruby methods), and would like to port their code without > re- > writing the IB actions with the block syntax (so, just adding > ib_action :myMethod after each method). > > So, the 2 usages would be possible. > > Thoughts? > I think that's what Hisa-san was talking about in the first reply. module ObjcCWrapper def ib_action(name, &blk) if block_given? then define_method(name,blk) end end end > Laurent > Cheers, Chris