error calling target of menu item
In the meantime to get around the thread problem I emailed about, I though I would add an NSMenuItem to the menu so that the user can click an 'Update Now' button and update the data on demand. However, whenever any of my menuitems are clicked I get the same error: /Users/karl/projects/gigameter/GigaMeter/build/Debug/GigaMeter.app/Contents/Resources/rb_main.rb:22:in `NSApplicationMain': wrong number of arguments (0 for 1) (ArgumentError) from /Users/karl/projects/gigameter/GigaMeter/build/Debug/GigaMeter.app/Contents/Resources/rb_main.rb:22:in `<main>' This is how my 'Update Now' menu items is declared (here *target* is a reference to the Controller instance): self.updateNow = self.menu.addItemWithTitle_action_keyEquivalent_('Update Now', 'actionUpdateNow', 'u') self.updateNow.enabled = true self.updateNow.target = target self.updateNow.toolTip = 'Update your Usage Data' and my Controller class has: class Controller attr_accessor :actionQuit, :actionConfigure, :actionUpdateNow def actionUpdateNow(sender) puts "action update called\n" doLogin saveDataToDisk self.menu.update(self.user) end ... end The menu is added to an NSStatusBar as so: menuZone = NSMenu.menuZone self.menu = NSMenu.allocWithZone(menuZone).init self.statusBar = NSStatusBar.systemStatusBar.statusItemWithLength(NSVariableStatusItemLength) self.statusBar.menu = self.menu Any ideas what's going on here? -- Karl Varga kjvarga@gmail.com Cell: +61 (0)4 2075 1356
Has anyone had any luck building the experimental branch under 10.6?
I'm using 10.5.7 but I would guess that Laurent runs on 10.6. - Matt On Mon, May 18, 2009 at 10:21 AM, Martin Hess <martinhess@me.com> wrote:
Has anyone had any luck building the experimental branch under 10.6? _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
participants (3)
-
Karl Varga
-
Martin Hess
-
Matt Aimonetti