NSMenu with IBAction method to click on menu title?
How can I grab the NSMenu header selection using the IBAction method generated in conjunction with the interface builder? I'm not sure if "title" is the correct word, so see the image below:
(source: physle.com )
Is it possible to create an action for this the way you can with a selection of regular NSMenuItems? I can create relationships in the interface constructor, but the method never fires.
+2
source to share
1 answer
Not really, but you can do it. If you get a pointer to the File menu, you can give it a delegate object. One of the methods of the NSMenuDelegate protocol is (void)menuWillOpen:(NSMenu *)menu
. You can probably use this to achieve the same effect as the targeting mechanism.
+4
source to share