Ticket #206 (closed defect: invalid)
HotCocoa: Mapped methods not available in subclass
| Reported by: | flatter@… | Owned by: | rich@… |
|---|---|---|---|
| Priority: | blocker | Milestone: | |
| Component: | MacRuby | Keywords: | hotcocoa |
| Cc: |
Description
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 #<MyBox:0x16c0230> (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 `<main>'
Change History
Note: See
TracTickets for help on using
tickets.

