pub struct NSApplication<'app, M = ()> {
pub ptr: Id<Object>,
/* private fields */
}
Expand description
An object that manages an app’s main event loop and resources used by all of that app’s objects.
Fields§
§ptr: Id<Object>
The underlying Objective-C object.
Implementations§
Source§impl<'app> NSApplication<'app>
impl<'app> NSApplication<'app>
Source§impl NSApplication<'_>
impl NSApplication<'_>
Sourcepub fn running(&self) -> bool
pub fn running(&self) -> bool
A Boolean value indicating whether the main event loop is running.
Sourcepub fn finish_launching(&mut self)
pub fn finish_launching(&mut self)
Activates the app, opens any files specified by the NSOpen user default, and unhighlights the app’s icon.
Sourcepub fn reply_to_application_should_terminate(&self, should_terminate: bool)
pub fn reply_to_application_should_terminate(&self, should_terminate: bool)
Responds to NSTerminateLater once the app knows whether it can terminate.
Sourcepub fn disable_relaunch_on_login(&mut self)
pub fn disable_relaunch_on_login(&mut self)
Disables relaunching the app on login.
Sourcepub fn enable_relaunch_on_login(&mut self)
pub fn enable_relaunch_on_login(&mut self)
Enables relaunching the app on login.
Sourcepub fn register_for_remote_notifications(&mut self)
pub fn register_for_remote_notifications(&mut self)
Register for notifications sent by Apple Push Notification service (APNs).
Sourcepub fn unregister_for_remote_notifications(&mut self)
pub fn unregister_for_remote_notifications(&mut self)
Unregister for notifications received from Apple Push Notification service.
Sourcepub fn reply_to_open_or_print(&self, response: NSApplicationDelegateReply)
pub fn reply_to_open_or_print(&self, response: NSApplicationDelegateReply)
Handles errors that might occur when the user attempts to open or print files.
Sourcepub fn activation_policy(&self) -> NSApplicationActivationPolicy
pub fn activation_policy(&self) -> NSApplicationActivationPolicy
Returns the app’s activation policy.
Sourcepub fn set_activation_policy(&mut self, policy: NSApplicationActivationPolicy)
pub fn set_activation_policy(&mut self, policy: NSApplicationActivationPolicy)
The app’s main menu bar.
Sets the app’s main menu bar.
Source§impl NSApplication<'_>
impl NSApplication<'_>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new NSApplication
,