[Lazarus] Lazarus Goal

Hess, Philip J pjhess at purdue.edu
Wed Nov 11 21:13:33 CET 2009


I did find a list of compatibility issues on OS X, but it's very, very sketchy. Better than nothing I suppose but only that.

http://wiki.lazarus.freepascal.org/Carbon_interface_internals#Compatibility_issues

I don't mean to be critical of Brian's app, but having menu bar items that respond to clicks as though they are buttons is rather perculiar, certainly non-standard even on Windows. I think the only app I've ever seen that does that is Dave Baldwin's TFrameViewer demo app included with his HTML components package, where he has an About item on the menu bar that does not have a submenu. Very disconcerting when you click that and it doesn't drop down.

What Dimitry means is that in some cases you need to conditional-ize your code to conform to expectations and style guides on the target platform. So when I ported Dave's package, I inserted this code to take care of the whacky About item:

{$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}

Not only does this eliminate About as a submenu, it also moves it to the correct place - and only on OS X too.

Thanks.

-Phil

________________________________________
From: dmitry boyarintsev [skalogryz.lists at gmail.com]
Sent: Wednesday, November 11, 2009 3:00 PM
To: Lazarus mailing list
Subject: Re: [Lazarus] Lazarus Goal

I've managed to compile the program and launch it on OSX, so i guess
"Write once, compile anywhere" works.

Too bad that OSes are too different, so some cross-platform style
should be followed while writing the code.

thanks,
dmitry

--
_______________________________________________
Lazarus mailing list
Lazarus at lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




More information about the Lazarus mailing list