IB calling init of AppKit subclass [was Re: Window Styles]
IB calling init of AppKit subclass [was Re: Window Styles]
- Subject: IB calling init of AppKit subclass [was Re: Window Styles]
- From: Brent Gulanowski <email@hidden>
- Date: Sun, 16 May 2004 10:45:21 -0400
On May 15, 2004, at 4:57 AM, Jeremy Dronfield wrote:
>
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;
>
}
I sent a question to the list last week wherein I was subclassing
NSTableColumn. I overrode the designated initializer just as suggested
here, but after changing the custom class attribute, IB stopped calling
my init method.
Ondra basically implied that that was just how it was and provided a
workaround (no-one answered my follow-up question, btw). Jeremy, are
you now saying that it should have worked? Or does it work for some
classes and not others?
--
Brent Gulanowski email@hidden
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.