[MacRuby-devel] [MacRuby] #206: HotCocoa: Mapped methods not available in subclass

2009-01-14 Thread MacRuby
#206: HotCocoa: Mapped methods not available in subclass
---+
 Reporter:  flat...@…  |   Owner:  lsansone...@…
 Type:  defect |  Status:  new  
 Priority:  blocker|   Milestone:  MacRuby 1.0  
Component:  MacRuby|Keywords:  hotcocoa 
---+
 I'm trying to build a custom NSBox in a MacRuby X-Code project. This is my
 code:

 {{{

 require 'hotcocoa'

 # make sure that this file is loaded.
 require 'hotcocoa/mappings/color'

 class MyBox < NSBox

   include HotCocoa::Behaviors

   def initWithFrame(frame)
 super
 setDefaults
   end

   def awakeFromNib
 setDefaults
   end

   def setDefaults
 setBoxType :NSBoxCustom
 setBorderType :NSLineBorder
 borderWidth = 2.0
 setBorderColor(color :red => 0.29, :green => 0.26, :blue => 0.55)
   end

 end
 }}}

 results in

 {{{

 MyBox.rb:18:in `setDefaults': undefined method `color' for
 # (NoMethodError)
 from .../.../My.app/Contents/Resources/MyBox.rb:7:in
 `initWithFrame'
 from
 .../.../MyApp/build/Release/My.app/Contents/Resources/rb_main.rb:24:in
 `NSApplicationMain'
 from
 .../.../MyApp/build/Release/My.app/Contents/Resources/rb_main.rb:24:in
 `'


 }}}

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] [MacRuby] #207: Kernel#framework calls global #copy method while loading Cocoa.

2009-01-14 Thread MacRuby
#207: Kernel#framework calls global #copy method while loading Cocoa.
-+--
 Reporter:  eloy.de.en...@…  |   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  blocker  |   Milestone:   
Component:  MacRuby  |Keywords:   
-+--
 This is something I stumbled across when playing with Rake. I have
 isolated it to the following:

 {{{
 % macirb
 irb(main):001:0> module Kernel
 irb(main):002:1> def copy(*args) p args; end
 irb(main):003:1> end
 => nil
 irb(main):004:0> framework "Foundation"
 => true
 irb(main):005:0> framework "Cocoa"
 []
 []
 []
 []
 []
 []
 => true
 }}}

 It also breaks if the arity of the #copy method is specified:

 {{{
 % macirb
 irb(main):001:0> module Kernel
 irb(main):002:1> def copy(one_arg); end
 irb(main):003:1> end
 => nil
 irb(main):004:0> framework 'Cocoa'
 ArgumentError: wrong number of arguments (0 for 1)
 from (irb):4:in `framework'
 from (irb):4
 from /usr/local/bin/macirb:12:in `'
 }}}

 So it seems like something is being evaluated which calls a #copy method
 while loading frameworks.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel