-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
standardWindowButton returns nil #7
Comments
I found that calling for example [NSWindow standardWindowButton:NSWindowCloseButton forStyleMask:self.styleMask] fixes it. HTH |
I ran into the same issue when creating window programmatically. Explanation (from docs): class func standardWindowButton(NSWindowButton, for: NSWindowStyleMask)
func standardWindowButton(NSWindowButton)
@weAreYeah Is this repo still maintained? If I submit a PR for this, is anybody going to merge it in? |
Btw. I was only seeing this error when I created window without specifying style masks for all three buttons, i.e.: self.init(contentRect: rect, styleMask: [.titled], backing: .buffered, defer: false) Once I added the appropriate style masks, everything works fine: self.init(contentRect: rect, styleMask: [.titled, .closable, .miniaturizable, .resizable], backing: .buffered, defer: false) |
Hi! I'm trying to create a window by code:
self = [super initWithContentRect:rect styleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask backing:NSBackingStoreBuffered defer:NO];
and I got an error saying that it was trying to add nil to an array. I found that the problem is in the line:
_standardButtons = @[[self standardWindowButton:NSWindowCloseButton],
[self standardWindowButton:NSWindowMiniaturizeButton],
[self standardWindowButton:NSWindowZoomButton]];
standardWindowButton: is returning nil for all 3 calls. any idea? I'm on 10.10.1
TIA
The text was updated successfully, but these errors were encountered: