Class: OSX::NSApplication
- Inherits:
-
Object
- Object
- OSX::NSApplication
- Defined in:
- src/ruby/osx/objc/cocoa_macros_appkit.rb
Overview
Utility functions for NSApplication.
Defined Under Namespace
Classes: RBCCTemporaryDelegate
Class Method Summary (collapse)
-
+ (Object) run_with_temp_app(terminate = true, &proc)
Runs given block as a Cocoa application.
Class Method Details
+ (Object) run_with_temp_app(terminate = true, &proc)
Runs given block as a Cocoa application.
37 38 39 40 41 42 43 44 45 46 |
# File 'src/ruby/osx/objc/cocoa_macros_appkit.rb', line 37 def NSApplication.run_with_temp_app(terminate = true, &proc) # prepare delegate delegate = RBCCTemporaryDelegate.alloc.init delegate.proc = proc delegate.terminate = terminate # run a new app app = NSApplication.sharedApplication app.setDelegate(delegate) app.run end |