I'm stuck! Obviously... because I'm posting a question here.
I have built my own custom window controls for my OS X / cocoa app. The close button works great -- no problems. The minimize button doesn't work at all when I disable the titlebar.
So when the title bar is on like the image above and I hit this method, the minimizing works fine:
ViewController.h
@interface ViewController : NSViewController {
- (IBAction)minimize:(id)sender;
@property (strong) IBOutlet NSButton *btn_minimize;
}
@end
ViewController.m
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
- (IBAction)minimize:(id)sender {
[[NSApp mainWindow] performMiniaturize:self];
}
-(IBAction)terminate:(id)sender {
[NSApp terminate:self];
}
@end
Then if I disable the title bar, that same method stops working. No errors, nothing. I've tried both: [[NSApp mainWindow] miniaturize:nil];
and also [[NSApp mainWindow] performMiniaturize:self];
. Neither of which worked. Actually... the both work IF the title bar is on. But once I turn it off, neither work.
Thoughts / comments?
Oh, I'm using Storyboards, Xcode 7, and am targeting 10.10 and using the 10.11 SDK if that matters at all.
Thanks in advance.