Class: Opine::Native::Application
- Inherits:
-
Application
- Object
- Widget
- Application
- Opine::Native::Application
- Defined in:
- lib/opine/widgets/application_osx.rb,
lib/opine/widgets/application_win.rb
Defined Under Namespace
Classes: OSXApplication
Constant Summary
Constants inherited from Application
Instance Attribute Summary
Attributes inherited from Application
Instance Method Summary collapse
-
#initialize(options, &block) ⇒ Application
constructor
A new instance of Application.
- #running? ⇒ Boolean
- #stop ⇒ Object
- #terminate ⇒ Object
Methods inherited from Application
#alert, #theme, theme, #theme=, #window
Constructor Details
#initialize(options, &block) ⇒ Application
Returns a new instance of Application.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/opine/widgets/application_osx.rb', line 27 def initialize(,&block) super Cocoa::NSAutoreleasePool.new @application = Cocoa::NSApplication.sharedApplication application.setActivationPolicy Cocoa::NSApplicationActivationPolicyRegular delegate = OSXApplication.alloc.init.autorelease delegate.application = application delegate.block = ->() do instance_eval(&block) if block end application.setDelegate delegate application.run end |
Instance Method Details
#running? ⇒ Boolean
43 44 45 |
# File 'lib/opine/widgets/application_osx.rb', line 43 def running? application.isRunning end |
#stop ⇒ Object
51 52 53 |
# File 'lib/opine/widgets/application_osx.rb', line 51 def stop application.stop application end |
#terminate ⇒ Object
47 48 49 |
# File 'lib/opine/widgets/application_osx.rb', line 47 def terminate application.terminate application end |