Re: Window Styles
Re: Window Styles
- Subject: Re: Window Styles
- From: Jeremy Dronfield <email@hidden>
- Date: Sat, 15 May 2004 09:57:18 +0100
On 15 May 2004, at 9:15 am, Mark Thomas wrote:
1) How can can you get another another window style for a window in
IB
???,
"Window style"? Not sure whether you mean Brushed Metal or just
altering the attributes, but both may be found in the inspector.
I was trying to do a plain window style, but I always end up with the
title bar being there. Unless I have missed something.
What you're referring to as plain is called a "borderless" window, and
you can't do it in IB. Instead, create your window as normal in IB,
then subclass NSWindow and set your window's Custom Class to your
subclass. In the subclass's implementation file, initialise the window
like so:
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned
int)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag {
if (self = [super initWithContentRect:contentRect
styleMask:NSBorderlessWindowMask // this is the important bit
backing:NSBackingStoreBuffered
defer:NO]) {
return self;
}
return nil;
}
If you want your borderless window to be able to receive keyboard
events, you will also want to override:
- (BOOL) canBecomeKeyWindow {
return YES;
}
Hope this helps.
Regards,
-Jeremy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.