Reputation: 15464
How can I capture the selection of a NSMenu header with an IBAction method created in connection with interface builder? I am not sure "header" is the right word so see the image below:
(source: physle.com)
Is it possible to create an action for this the way you can with the selection of regular NSMenuItems? I can create the relationship in interface builder but the method never fires.
Upvotes: 2
Views: 677
Reputation: 243146
Not exactly, but you can do it. If you acquire a pointer to the File menu itself, you can give it a delegate object. One of the methods of the NSMenuDelegate protocol is (void)menuWillOpen:(NSMenu *)menu
. You could probably use this to achieve the same effect as a target-action mechanism.
Upvotes: 4