Re: IB calling init of AppKit subclass [was Re: Window Styles]
Re: IB calling init of AppKit subclass [was Re: Window Styles]
- Subject: Re: IB calling init of AppKit subclass [was Re: Window Styles]
- From: Vince DeMarco <email@hidden>
- Date: Sun, 16 May 2004 08:49:47 -0700
On May 16, 2004, at 7:45 AM, Brent Gulanowski wrote:
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?
This is asked all of the time. please look at Interface Builder, under
the Help menu there is a FAQ menu.
Please check that out.
it does explain all of this.
vince
_______________________________________________
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.