Projects

Ticket #206 (closed defect: invalid)

Opened 3 years ago

Last modified 18 months ago

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

Changed 3 years ago by eloy.de.enige@…

Hey Alexander,

Is this still the case for you?

Changed 3 years ago by anonymous

  • milestone MacRuby 1.0 deleted

Milestone MacRuby 1.0 deleted

Changed 2 years ago by lsansonetti@…

  • owner changed from lsansonetti@… to rich@…

Assigning to Rich for screening.

Changed 18 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to invalid

HotCocoa is no longer developed here. Please report the problem to  http://github.com/richkilmer/hotcocoa.

Note: See TracTickets for help on using tickets.