cocoa: move attaching of AppleMenu into cocoaWS class (as at windows class). Resolving glitches with an empty menu

git-svn-id: trunk@61468 -
This commit is contained in:
dmitry 2019-06-24 15:24:14 +00:00
parent 81580355ac
commit b61d8f9ba2
2 changed files with 4 additions and 1 deletions

View File

@ -680,6 +680,10 @@ begin
PrevMenu.retain;
PrevLCLMenu := CurLCLMenu;
if (lNSMenu.isKindOfClass(TCocoaMenu)) then
TCocoaMenu(lNSMenu).attachAppleMenu();
NSApp.setMainMenu(lNSMenu);
CurLCLMenu := ALCLMenu;

View File

@ -367,7 +367,6 @@ begin
if NSObject(ACustForm.Menu.Handle).isKindOfClass_(TCocoaMenu) then
begin
CocoaWidgetSet.SetMainMenu(ACustForm.Menu.Handle, ACustForm.Menu);
TCocoaMenu(ACustForm.Menu.Handle).attachAppleMenu();
end
else
debugln('Warning: Menu does not have a valid handle.');