When is NSView stencil included?

When writing a custom view, NSMenuItem

I refer to the related ones NSMenuItem

via a message NSView

enclosingMenuItem

. I would like to be able to update some of the subheadings of my custom view NSMenuItem

as soon as I know that the injected menu item is set, but there is no setter override.

I am currently updating the subviews in the override viewWillMoveToWindow:

, but this causes an issue where for a short moment after opening the menu the custom view is the wrong size. It resizes quickly to fit the constraints of the layout, but the transition is visible and I want to avoid it.

+3


source to share





All Articles