And as usual I realized my misunderstanding a very short time after posting to 
the list :)

The problem is that the xojo object is separate from the NSMenuItem as far as 
the system is concerned and if you’re going to subclass the menu and set the 
menuFormRepresentation you have to keep a local reference to the menu subclass 
in order for it to work. As soon as I did that I started getting events from my 
menu subclass. 

I still don’t know why it’s necessary to do that and not just trap the menu 
event in the CustomNSToolBarItemMBS class as happens before you change the 
.view property, but this is a workAround for the moment.

> On Apr 7, 2017, at 12:12 PM, James Sentman <[email protected]> wrote:
> 
> I attempted to create an NSMenuItemMBS subclass and assign that to the 
> menuFormRepresentation property of the toolitem and that works as far as 
> being able to enable and disable the menu as well as change it’s title, but 
> the event still doesn’t filter down to the new class. The Action event of the 
> NSMenuItemMBS subclass is never called.

Thanks,
 James


James Sentman                       http://www.PlanetaryGear.org                
http://MacHomeAutomation.com




_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to