Class: Opine::Native::Application::OSXApplication
- Inherits:
-
Cocoa::NSObject
- Object
- Cocoa::NSObject
- Opine::Native::Application::OSXApplication
- Defined in:
- lib/opine/widgets/application_osx.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
-
#block ⇒ Object
Returns the value of attribute block.
Instance Method Summary collapse
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
5 6 7 |
# File 'lib/opine/widgets/application_osx.rb', line 5 def application @application end |
#block ⇒ Object
Returns the value of attribute block.
5 6 7 |
# File 'lib/opine/widgets/application_osx.rb', line 5 def block @block end |
Instance Method Details
#applicationDidFinishLaunching(notification) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/opine/widgets/application_osx.rb', line 7 def applicationDidFinishLaunching notification = NSMenu.new.autorelease = NSMenuItem.new.autorelease .addItem application.setMainMenu = NSMenu.new.autorelease = NSMenuItem.alloc.initWithTitle("Quit", action: :terminate, keyEquivalent: 'q' ).autorelease .addItem . application.activateIgnoringOtherApps true block.call if block end |