Ticket #169 (closed defect: fixed)
[HotCocoa] status_item mapping doesn't appear to work
| Reported by: | chris@… | Owned by: | rich@… |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | MacRuby | Keywords: | |
| Cc: | chris@…, drnicwilliams@… |
Description
I'm porting a little single file rubycocoa app to check out hotcocoa but ran into a little problem with the code below:
require 'hotcocoa'
class Application
include HotCocoa
def start
application :name => "MacMenu" do |app|
app.delegate = self
@item = status_item
#@item = status_bar.statusItemWithLength NSVariableStatusItemLength
@item.title = "MacMenu"
end
end
end
Application.new.start
The @item = status_item call causes the following error:
/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.0/hotcocoa/mappings/status_item.rb:6:in `alloc_with_options': undefined local variable or method `status_bar' for #<HotCocoa::Mappings::Mapper:0x80039e6e0> (NameError) from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.0/hotcocoa/mapper.rb:48:in `block in map_method' from hotcocoa_menu_test.rb:9:in `block in start' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.0/hotcocoa/mappings/application.rb:9:in `call' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.0/hotcocoa/mappings/application.rb:9:in `handle_block' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.0/hotcocoa/mapper.rb:67:in `block in map_method' from hotcocoa_menu_test.rb:7:in `start' from hotcocoa_menu_test.rb:16:in `<main>'
Using the commented out line instead everything is fine.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


