Handling menu events in cocoa

How to handle events in the menu bar, that is, if I click the "quit" or "about" button in the menu bar where the control is located.

Thanks in advance,

+3
source share
1 answer

To understand this, you will need to read the responder chain . Youโ€™ll want to pay particular attention to the โ€œActivity Messagesโ€ section at the bottom of the page that I am associated with. The Nil-target action is sent to the first responder. This is how menu items usually work.

About Quit MainMenu.xib, NSApplication. , , -orderFrontStandardAboutPanel: -terminate:. NSApplication, . , .

+4

Source: https://habr.com/ru/post/1754231/


All Articles