[AD] Re: GCC 4 warnings for MacOS X

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


alleg-developers-request@xxxxxxxxxx wrote:

Cheers.  Committed all the patches except this:
--- src/macosx/main.m	Sun Jul 11 12:15:30 2004 UTC
+++ src/macosx/main.m	Mon May 16 04:32:54 2005 UTC
@@ -223,7 +223,7 @@
      keyEquivalent: @""];
   [[NSApp mainMenu] addItem: temp_item];
   [[NSApp mainMenu] setSubmenu: menu forItem: temp_item];
-   [NSApp setAppleMenu: menu];
+   //   [NSApp setAppleMenu: menu];
   NSString *quit = @"Quit ";
   menu_item = [[NSMenuItem allocWithZone: [NSMenu menuZone]]
      initWithTitle: [quit stringByAppendingString: [[NSProcessInfo processInfo] processName]]

I realise that the setAppleMenu method seems to have disappeared (!).
Is it okay just to comment out that call?  What was it supposed to do?

Peter

I've been on holiday! Apologies for the delay in commenting...

The documentation is a little vague on this, but it appears that the 'Apple Menu' is not the one on the left with an Apple logo, but the one immediately to the right of it, which has the application name on it*. setAppleMenu seems to 'bless' the menu in some way, so that it gets the application title.

I don't have 10.4, only 10.2, so I can't investigate things fully here. I believe that 10.3 would do the same as 10.2 in this regard. In general, if I omit setAppleMenu, the system inserts a blank menu with the application title, then my menu appears to the right of it.

I would be interested to hear what happens if someone with 10.4 compiles an Allegro app with the above patch applied. Maybe 10.4 automatically turns the first menu into the Apple menu, or maybe you will also get two menus?

If it is the former, it's easy enough to call setAppleMenu conditionally, only if NSApplication supports it**. That would cover both cases. If it is the latter, I'm stuck! Hopefully Apple will clarify their docs.

Pete

* presumably, little features like this are designed to keep qualified Mac programmers in paid employment.
** something like: (untested!)
if ([NSApp respondsToSelector: @selector(setAppleMenu:)]) {
[NSApp setAppleMenu: menu];
}




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/