• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Re: NSWindow from code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: New question about borken NSOperationQueue
  • Next by Date: Field editor undo vs document dirty
  • Previous by thread: Re: NSWindow from code
  • Next by thread: Does waitUntilExit really mean that?
  • Index(es):
    • Date
    • Thread