[Ironruby-core] delegate

Huw Collingbourne lists at ruby-forum.com
Mon Feb 4 05:56:56 EST 2008


Michael Letterle wrote:
> What I'm saying is eventually you'll be able to something like
> 
> rbutton.Click{|sender, e| puts "Clicked!"}
> rbutton.Click{|sender, e| puts "Also Clicked!"}
> 

That's still not quite delegation in the usual sense. What if we have:

def onClick( sender )
  # do something
end

...then have this single method 'wired up' to the Click events on, say, 
the 50+ buttons of a scientific calculator? In short, the delegated 
methods need to be detached from specific objects. I'm sure the IronRuby 
team will provide this in time. It makes a big difference when it comes 
to implementing code+form integration ;-)

best wishes
Huw

SapphireSteel Software
Ruby and Rails In Visual Studio
http://www.sapphiresteel.com
-- 
Posted via http://www.ruby-forum.com/.


More information about the Ironruby-core mailing list