Difference between revisions of "Cocoa Internals/Menu"

From Free Pascal wiki
Jump to navigationJump to search
m
Line 1: Line 1:
 +
Menu logic in macOS is different from the one in Windows (and other systems). The entire application only has one menu on top. That's it. There are no "per window" menus attached. (instead a window could use a Toolbar instead)
 +
 +
==Basic Logic==
 +
* The TMainMenu of the active window is set as the Application menu
 +
* If active window doesn't have TMainMenu the last active window with TMainMenu is still used
 +
* The Window running as modal disables the main menu, UNLESS it has its own main menu.
 +
==Implementation==
 +
 
==See Also==
 
==See Also==
 
* [[Cocoa Internals/Application]]
 
* [[Cocoa Internals/Application]]

Revision as of 04:50, 10 October 2021

Menu logic in macOS is different from the one in Windows (and other systems). The entire application only has one menu on top. That's it. There are no "per window" menus attached. (instead a window could use a Toolbar instead)

Basic Logic

  • The TMainMenu of the active window is set as the Application menu
  • If active window doesn't have TMainMenu the last active window with TMainMenu is still used
  • The Window running as modal disables the main menu, UNLESS it has its own main menu.

Implementation

See Also