Is there a way to have the method performClose: working when i use NSBorderlessWindowMask? What method do i have to override ? (if its possible)
i have overridden some methods, and it works. All I want to know now is if i didn't take it from the bad approach :)
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
{
return ([menuItem action] == @selector(performClose:) || [menuItem action] == @selector(performZoom:) || [menuItem action] == @selector(performMiniaturize:)) ? YES : [super validateMenuItem:menuItem];
}
- (BOOL)windowShouldClose:(id)sender
{
return YES;
}
- (void)performClose:(id)sender
{
if([[self delegate] respondsToSelector:@selector(windowShouldClose:)])
{
if(![[self delegate] windowShouldClose:self]) return;
}
else if([self respondsToSelector:@selector(windowShouldClose:)])
{
if(![self windowShouldClose:self]) return;
}
[self close];
}
- (void)performMiniaturize:(id)sender
{
[self miniaturize:self];
}
- (void)performZoom:(id)sender
{
[self zoom:self];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With