|
From: Jonathan P. <jp...@dc...> - 2006-02-07 10:35:24
|
On 7 Feb 2006, at 10:16, Yvon Thoraval wrote: > Hey all, > > i've written a first app using RubyCocoa, in this app i've a button > "Quit" whose action is "quitter" the method "quitter" within > Controller.rb, is "simply" : > > def quitter(sender) > exit 0 > end Try: OSX::NSApplication.sharedApplication.terminate(nil) You can see the documentation for this method in Xcode's Documentation window by searching for 'terminate:'. Having said that, you can wire the button up directly in Interface Builder without having to add any extra code :) -- try this: control-drag from the qutton to "File's Owner" double click 'terminate:' in the Target/Action list that appears That's it! |