summaryrefslogtreecommitdiff
path: root/src/video/cocoa
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2009-10-04 21:39:08 +0000
committermichi_cc <michi_cc@openttd.org>2009-10-04 21:39:08 +0000
commit6ad7440ae5b67f69e3ba7b255f192c8732db621d (patch)
treeb9a290858fc71efb713dfdcacf74e6db79e1ba65 /src/video/cocoa
parentdbb13fd8565536374ff3b1b8ceb8d95a1af04e29 (diff)
downloadopenttd-6ad7440ae5b67f69e3ba7b255f192c8732db621d.tar.xz
(svn r17716) -Codechange: [OSX] Invoke a (semi-)private Objective-C method in a way that does not rely on the SDK version.
Diffstat (limited to 'src/video/cocoa')
-rw-r--r--src/video/cocoa/cocoa_v.mm13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm
index 64624aa89..530e1ddb1 100644
--- a/src/video/cocoa/cocoa_v.mm
+++ b/src/video/cocoa/cocoa_v.mm
@@ -44,13 +44,6 @@
* Read http://developer.apple.com/releasenotes/Cocoa/Objective-C++.html for more information.
*/
-/* Disables a warning. This is needed since the method exists but has been dropped from the header, supposedly as of 10.4. */
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
-@interface NSApplication(NSAppleMenu)
-- (void)setAppleMenu:(NSMenu *)menu;
-@end
-#endif
-
@interface OTTDMain : NSObject
@end
@@ -116,8 +109,10 @@ static void setApplicationMenu()
[ menuItem setSubmenu:appleMenu ];
[ [ NSApp mainMenu ] addItem:menuItem ];
- /* Tell the application object that this is now the application menu */
- [ NSApp setAppleMenu:appleMenu ];
+ /* Tell the application object that this is now the application menu.
+ * This interesting Objective-C construct is used because not all SDK
+ * versions define this method publicly. */
+ [ NSApp performSelector:@selector(setAppleMenu:) withObject:appleMenu ];
/* Finally give up our references to the objects */
[ appleMenu release ];