From e55396d75432a3386af70c3737054f5ff3d7db01 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 5 Mar 2012 20:09:06 +0100 Subject: [PATCH] Shortened call to setAppleMenu:. --- src/cocoa_window.m | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 239e883a..defe8fce 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -469,13 +469,6 @@ static int convertMacKeyCode(unsigned int macKeyCode) @end -// Prior to Snow Leopard, we need to use this oddly-named semi-private API -// to get the application menu working properly. Need to be careful in -// case it goes away in a future OS update. -@interface NSApplication (NSAppleMenu) -- (void)setAppleMenu:(NSMenu*)m; -@end - //======================================================================== // Try to figure out what the calling application is called //======================================================================== @@ -584,11 +577,9 @@ static void setUpMenuBar(void) action:@selector(arrangeInFront:) keyEquivalent:@""]; - // At least guard the call to private API to avoid an exception if it - // goes away. Hopefully that means the worst we'll break in future is to - // look ugly... - if ([NSApp respondsToSelector:@selector(setAppleMenu:)]) - [NSApp setAppleMenu:appMenu]; + // Prior to Snow Leopard, we need to use this oddly-named semi-private API + // to get the application menu working properly. + [NSApp performSelector:NSSelectorFromString(@"setAppleMenu:") withObject:appMenu]; }