From: Joshua Ballanco Date: 2008-07-28T09:20:30+09:00 Subject: Re: Is there a better way to do this wxPython example in Rub Wayne Magor wrote: > Is there a better way to do this in Ruby? What about passing the method name as a Symbol and then using Object.send in the reciever? Something like: build_one_button(panel, "FIRST", :on_first) def build_one_button(parent, label, pos=[0,0], method_name) button = Wx::Button.new(parent, -1, label, pos) evt_button(button) {|event| self.send(method_name, event)} return button end -- Posted via http://www.ruby-forum.com/.