Re: Re: NSWindow from code
Re: Re: NSWindow from code
- Subject: Re: Re: NSWindow from code
- From: Jan Bernard Marsman <email@hidden>
- Date: Tue, 7 Apr 2009 08:50:28 +0200
Thanks Graham. I will do that.
I was thinking in terms of class portability to include these panels inside
my view (-controller) ;-)
JB
> On 07/04/2009, at 3:40 AM, Jan Bernard Marsman wrote:
>
> From my subclass of an NSView I call the (simplified) following:
>
> - openHUD {
>
> [NSButton * button] = <alloc & init>
>
> [NSWindow * w] = <alloc & init with some style>
>
> ...
>
> [[w contentView] addSubview: <button>]
>
> NSWindowController * nw = [NSWindowController initWithWindow:w];
>
> [nw showWindow:nil]
>
> }
>
>
>
> This sounds crazy - an NSView is opening a window? *Where* in NSView is
this called from?
Apart from breaking fundamental design principles (MVC for example), why
aren't you using Interface Builder? Don't fight the frameworks - unless you
have a *VERY* good reason to build your UI in code, don't bother. Using IB
is the path of least resistance, and is much easier than a) the alternatives
and b) it looks.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden