[MacRuby-devel] [MacRuby] #274: [HotCocoa] Button images

MacRuby ruby-noreply at macosforge.org
Sat May 30 18:51:21 PDT 2009


#274: [HotCocoa] Button images
---------------------------------+------------------------------------------
 Reporter:  dj2@…                |       Owner:  lsansonetti@…        
     Type:  enhancement          |      Status:  new                  
 Priority:  minor                |   Milestone:                       
Component:  MacRuby              |    Keywords:                       
---------------------------------+------------------------------------------

Comment(by rich@…):

 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/>



More information about the MacRuby-devel mailing list