#274: [HotCocoa] Button images ---------------------------------+------------------------------------------ Reporter: d...@… | Owner: lsansone...@… Type: enhancement | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------
Comment(by r...@…): Here is what I propose (with input from Laurent): When you use the hash of symbol => values in the construction of a hotcocoa mapped class internally what happens is some of the symbols/values are extracted by the constructor (like :frame, :layout, etc). The rest are iterated over inside the hotcocoa code to see if the instance respond_to?(:symbol=). If so, it calls that method. What I propose is to add additional logic which checks for setSymbolMethod, converting the underscored parameter into a camelcase setter and if it respond_to?(:setSymbolMethod) it dispatches. These will really clean up the mapping files because we can then remove things like movie_view's: def fill_color=(color) setFillColor(color) end With this change passing: movie_view :fill_color => color(:red) Will just work without that mapped method. This solves Dan's problem, and I think keeps hotcococoa cleaner. This will just be a documented behavior of construction with the hash parameter list. -- Ticket URL: <http://www.macruby.org/trac/ticket/274#comment:4> MacRuby <http://macruby.org/> _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel