[macruby] #84: NSColor method dispatching problems
#84: NSColor method dispatching problems ---------------------------------+------------------------------------------ Reporter: psychs@limechat.net | Owner: lsansonetti@apple.com Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ {{{ framework 'Cocoa' # it doesn't work c = NSColor.colorWithCalibratedRed_green_blue_alpha(1.0, 1.0, 1.0, 1.0) # it works c = NSColor.colorWithCalibratedRed(1.0, green:1.0, blue:1.0, alpha:1.0) # it doesn't work c.blendedColorWithFraction_ofColor(0.5, NSColor.greenColor) # it works c.blendedColorWithFraction(0.5, ofColor:NSColor.greenColor) }}} {{{ test.rb:4:in `<main>': undefined method `colorWithCalibratedRed_green_blue_alpha' for NSColor:Class (NoMethodError) }}} {{{ test.rb:10:in `<main>': undefined method `blendedColorWithFraction_ofColor' for #<NSCachedRGBColor:0x14b6070> (NoMethodError) }}} -- Ticket URL: <http://ruby.macosforge.org/trac/ticket/84> macruby <http://ruby.macosforge.org/>
#84: NSColor method dispatching problems ---------------------------------+------------------------------------------ Reporter: psychs@limechat.net | Owner: lsansonetti@apple.com Type: defect | Status: closed Priority: major | Milestone: Component: MacRuby | Resolution: invalid Keywords: | ---------------------------------+------------------------------------------ Changes (by lsansonetti@apple.com): * status: new => closed * resolution: => invalid Comment: This looks like an expected behavior. {{{colorWithCalibratedRed_green_blue_alpha(a, b, c, d)}}} is RubyCocoa- like syntax, which is not supported in !MacRuby. It has to be rewritten like {{{colorWithCalibratedRed(a, green:b, blue:c, alpha:d)}}}. Corresponding Objective-C method is: {{{+ (NSColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha}}} What do you think? -- Ticket URL: <http://ruby.macosforge.org/trac/ticket/84#comment:1> macruby <http://ruby.macosforge.org/>
#84: NSColor method dispatching problems ---------------------------------+------------------------------------------ Reporter: psychs@limechat.net | Owner: lsansonetti@apple.com Type: defect | Status: closed Priority: major | Milestone: Component: MacRuby | Resolution: invalid Keywords: | ---------------------------------+------------------------------------------ Comment (by eloy.de.enige@gmail.com): With the RubyCocoa layer: {{{ % macirb -rosx/cocoa irb(main):001:0> c = NSColor.colorWithCalibratedRed_green_blue_alpha(1.0, 1.0, 1.0, 1.0) => #<NSCachedRGBColor:0x1b148f0> irb(main):002:0> c.blendedColorWithFraction_ofColor(0.5, NSColor.greenColor) => #<NSCalibratedRGBColor:0x1b36d10> }}} -- Ticket URL: <http://ruby.macosforge.org/trac/ticket/84#comment:2> macruby <http://ruby.macosforge.org/>
#84: NSColor method dispatching problems ---------------------------------+------------------------------------------ Reporter: psychs@limechat.net | Owner: lsansonetti@apple.com Type: defect | Status: closed Priority: major | Milestone: Component: MacRuby | Resolution: invalid Keywords: | ---------------------------------+------------------------------------------ Comment (by psychs@limechat.net): I think it should be treated in RubyCocoa compatibility layer. The layer is cool. Thanks. -- Ticket URL: <http://ruby.macosforge.org/trac/ticket/84#comment:3> macruby <http://ruby.macosforge.org/>
#84: NSColor method dispatching problems ---------------------------------+------------------------------------------ Reporter: psychs@limechat.net | Owner: lsansonetti@apple.com Type: defect | Status: closed Priority: major | Milestone: Component: MacRuby | Resolution: invalid Keywords: | ---------------------------------+------------------------------------------ Comment (by lsansonetti@apple.com): Works well :) But Satoshi-san here is porting LimeChat to MacRuby, so he definitely wants to rewrite the syntax. -- Ticket URL: <http://ruby.macosforge.org/trac/ticket/84#comment:4> macruby <http://ruby.macosforge.org/>
participants (1)
-
macruby