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
objective-c cocoa nsview nsmenuitem


source to share


No one has answered this question yet

Check out similar questions:

1665
How can I get the UITextField to move upward when there is a keyboard - when starting editing?
91
Specifying One Cell Dimension in UICollectionView Using Auto Layout
56
Hidden back NSView and twisted siblings
6
How can I get the NSView to be resized to fit the desired sizes of its subzones using Auto Layout?
five
NSView drawRect interferes with subviews?
2
How can I automatically link a view from another xib / nib as a subview within a split view programmatically?
1
Swift: Resize inline custom NSView
1
Auto layout constraints in NSView only after hitting edge
0
How to resize subview subview based on autoplay?
0
NSView resizing with auto layout doesn't work



All Articles
Loading...
X
Show
Funny
Dev
Pics