Fixes #82
This commit is contained in:
parent
a1f2711ceb
commit
589ff8c789
|
@ -69,7 +69,7 @@ pub(crate) static APP_PTR: &str = "rstAppPtr";
|
|||
|
||||
/// A handler to make some boilerplate less annoying.
|
||||
#[inline]
|
||||
fn shared_application<T, F: Fn(id) -> T>(handler: F) -> T {
|
||||
pub(crate) fn shared_application<T, F: Fn(id) -> T>(handler: F) -> T {
|
||||
let app: id = unsafe { msg_send![register_app_class(), sharedApplication] };
|
||||
handler(app)
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ impl<T> App<T> {
|
|||
pub fn run(&self) {
|
||||
unsafe {
|
||||
//let current_app: id = msg_send![class!(NSRunningApplication), currentApplication];
|
||||
let shared_app: id = msg_send![class!(RSTApplication), sharedApplication];
|
||||
let shared_app: id = msg_send![register_app_class(), sharedApplication];
|
||||
let _: () = msg_send![shared_app, run];
|
||||
self.pool.drain();
|
||||
}
|
||||
|
|
|
@ -165,8 +165,12 @@ impl MenuItem {
|
|||
// supported by MenuItem yet.
|
||||
Self::Services => {
|
||||
let item = make_menu_item("Services", None, None, None);
|
||||
let app: id = msg_send![class!(RSTApplication), sharedApplication];
|
||||
|
||||
let services = crate::appkit::app::shared_application(|app| {
|
||||
let services: id = msg_send![app, servicesMenu];
|
||||
services
|
||||
});
|
||||
|
||||
let _: () = msg_send![&*item, setSubmenu: services];
|
||||
item
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue