In writing a custom NSMenuItem
view, I am accessing the associated NSMenuItem
via the NSView
enclosingMenuItem
message. I would like to be able to update some subviews of my custom NSMenuItem
view just as soon as I know that the enclosing menu item is set, but there is no setter that can be overridden.
Currently I am updating the subviews within an override of viewWillMoveToWindow:
, but this is causing a problem where, for a brief moment after the menu is opened, the custom view is incorrectly sized. It quickly resizes according to the layout constraints, but the changeover is noticeable and I want to avoid it.