DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2665
Version: 1.3-current


The application name used by FLTK when generating the main menu on OS X is
wrong as it always uses the process name instead of the bundle one.
Attached is a patch that mimics the way the system figures out the
application name.


Link: http://www.fltk.org/str.php?L2665
Version: 1.3-current
diff -up fltk-1.3.x-r8772/src/Fl_cocoa.mm.orig fltk-1.3.x-r8772/src/Fl_cocoa.mm
--- fltk-1.3.x-r8772/src/Fl_cocoa.mm.orig       2011-06-16 12:32:39.262088892 
+0200
+++ fltk-1.3.x-r8772/src/Fl_cocoa.mm    2011-06-16 13:00:42.680073109 +0200
@@ -3127,7 +3140,9 @@ static void createAppleMenu(void)
   NSMenuItem *menuItem;
   NSString *title;
 
-  NSString *nsappname = [[NSProcessInfo processInfo] processName];
+  NSString *nsappname = [[[NSBundle mainBundle] infoDictionary] 
objectForKey:@"CFBundleName"];
+  if (nsappname == nil)
+    nsappname = [[NSProcessInfo processInfo] processName];
   appleMenu = [[NSMenu alloc] initWithTitle:@""];
   /* Add menu items */
   title = [[NSString stringWithUTF8String:Fl_Mac_App_Menu::about] 
stringByAppendingString:nsappname];
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to