Add a menu item to the application menu lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- havezet · 2010-11-16 07:27 This is probably a newbie question so my apologies if I overlooked the obvious. How can I add a menu item to the application menu in MacOS? So I mean the menu titled after the application that appears at the far left, directly next to the apple menu when my application is running. I'd like to include an About menu entry there as is common in MacOS applications. Thank you ---------------------------------------------------------------------- Phil · 2010-11-16 11:56 If you're doing cross-platform development and already have an About menu item elsewhere (e.g., on Help menu as in Windows), here's example code from this project: http://wiki.lazarus.freepascal.org/THtmlPort In main form declaration: {$IFDEF LCLCarbon}     AppMenu : TMenuItem; {$ENDIF} In FormCreate handler: {$IFDEF LCLCarbon}   AppMenu := TMenuItem.Create(Self);  //Application menu   AppMenu.Caption := #$EF#$A3#$BF;  //Unicode Apple logo char   MainMenu1.Items.Insert(0, AppMenu);   MainMenu1.Items.Remove(About1);  //Remove About as separate menu   AppMenu.Add(About1);  //Add About as item in application menu {$ENDIF} I'm preparing an article on this and other things that need to be done specially on Mac with Lazarus. Thanks. -Phil ---------------------------------------------------------------------- havezet · 2010-11-16 12:50 Thanks Phil. Works like a charm! ---------------------------------------------------------------------- kamischi · 2010-11-16 14:19 My code snippet for the about menu: http://developer.berlios.de/snippet/detail.php?type=snippet&id=100054 Have fun. Mischi ---------------------------------------------------------------------- Phil · 2010-11-16 14:26 http://developer.berlios.de/snippet/detail.php?type=snippet&id=100054 1. You could use VK_OEM_COMMA instead of $BC to make it clearer. 2. Preferences item normally does not have an ellipsis. 3. About item should include bundle name (app name). Thanks. -Phil ---------------------------------------------------------------------- kamischi · 2010-11-17 18:19 Hi Phil Thanks for the feedback. I'll fix number 1 and 3, but it may take some time :-) However, regarding point 2, the ellipsis (...), I checked a number of programs (Safari, iTunes, iCal, Mail, Colloquy, ...) on Mac OS X 10.6, German, and all have "..." after Preferences or the localized version "Einstellungen". The only one without "..." was good old Appleworks :-) The only difference I found is that some have a blank before "..." and some don't. Is this a localization thing? Greetings Michael ---------------------------------------------------------------------- Phil · 2010-11-17 21:04 Yes, you're right and I'm wrong. I guess I shouldn't try to recall anything from memory (wasn't at my Mac when I wrote that). Thanks. -Phil