Re: NSWindowControllers and NSWindow

2015-02-16 Thread Graham Cox
> On 17 Feb 2015, at 1:17 am, Dave wrote: > > My initial thought were to have a WindowController: > > LTWMainWindowController that looks after a number of Windows. Initial there > is just one window LTWWindowX (but I want to add others in the future, > LTWWindowY, LTWWindowZ, etc.), each wind

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Roland King
> On 17 Feb 2015, at 5:59 am, Quincey Morris > wrote: > >> On Feb 16, 2015, at 12:30 , Ken Thomases wrote: >> >> A view controller and its view should be reusable in different contexts, or >> at least designed as though it might be. > > To round out the larger discussion for posterity, I

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Quincey Morris
On Feb 16, 2015, at 12:30 , Ken Thomases wrote: > > A view controller and its view should be reusable in different contexts, or > at least designed as though it might be. To round out the larger discussion for posterity, I’d add that when using an OS X storyboard, the picture is a little bit d

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Raglan T. Tiger
> On Feb 16, 2015, at 2:38 PM, Jens Alfke wrote: > > I’m surprised by how complicated the discussion is making this seem! Me too ! -rags ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Jens Alfke
> On Feb 16, 2015, at 9:55 AM, Dave wrote: > > I can see I could do it if I had LTWViewController.xib that included an > NSWindow? I’m surprised by how complicated the discussion is making this seem! All you need to do is create an NSWindowController subclass in Xcode, check the “Also crea

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Bill Cheeseman
Excellent suggestions, as usual. Thanks, Ken! > On Feb 16, 2015, at 3:30 PM, Ken Thomases wrote: > > He clearly says that the MainMenu NIB should _not_ include a window: I thought I remembered that, but when I went back for a quick check I missed the passage you quoted. That must be where I g

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Ken Thomases
On Feb 16, 2015, at 12:39 PM, Bill Cheeseman wrote: > Although I follow Mike Ash's advice, I have separate MainMenu.xib and > MainWindow.xib files instead of a single window.xib file. My MainMenu.xib > contains the application's menu bar but no window. The construction of this sentence suggest

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Dave
> On 16 Feb 2015, at 18:39, Bill Cheeseman wrote: > > Although I follow Mike Ash's advice, I have separate MainMenu.xib and > MainWindow.xib files instead of a single window.xib file. My MainMenu.xib > contains the application's menu bar but no window. MainMenu.xib is owned by > NSApplicatio

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Dave
> Well, you've switched from talking about a window controller to a view > controller for some reason. Sorry, was a typo I meant LTWWindowController, I’m so used to typing ViewController that I guess my fingering did the thinking in this case! Fixed the warnings too, thanks again for your hel

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Ken Thomases
On Feb 16, 2015, at 11:55 AM, Dave wrote: >> You never want a NIB for the window controller that's separate from the NIB >> containing the window. You want a single NIB for the window which the >> window controller will load and be the owner of. The NIB will *not* >> "contain" the window con

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Steve Mills
On Feb 16, 2015, at 13:20:24, Dave wrote: > > Thanks, I solved it, the File’s Owner didn’t take for some reason, I did it > again and it seems to work ok now. > > However, I’m guessing that something isn’t right, since I now get two > warnings - > > /path/LTWMainWindow.xib: The initial posi

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Dave
Thanks, I solved it, the File’s Owner didn’t take for some reason, I did it again and it seems to work ok now. However, I’m guessing that something isn’t right, since I now get two warnings - /path/LTWMainWindow.xib: The initial position of this window is outside of this machine's screen. a

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Bill Cheeseman
> On Feb 16, 2015, at 10:24 AM, Dave wrote: > > Thanks for this, it seems to be saying there is no need for a separate Window > Subclass and that the Window Controller Subclass contains all the code needed > to drive the window. I’m a bit confused of when to use an NSWindow and when > to use

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Bill Cheeseman
> On Feb 16, 2015, at 12:55 PM, Dave wrote: > > LTWViewController.h and LTWViewController.m, and LTWWindow.xib, then set the > file owner in the NIB to “LTWViewController”, how do I then wire up outlets, > bindings and actions so that I get properties set in LTWViewController? Connect the UI

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Dave
> You never want a NIB for the window controller that's separate from the NIB > containing the window. You want a single NIB for the window which the window > controller will load and be the owner of. The NIB will *not* "contain" the > window controller. The File's Owner placeholder in the NI

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Jens Alfke
> On Feb 16, 2015, at 6:17 AM, Dave wrote: > > My initial thought were to have a WindowController: > LTWMainWindowController that looks after a number of Windows. Usually you have a separate NSWindowController subclass for each distinct type of window. If the windows share some functionality,

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Steve Mills
On Feb 16, 2015, at 09:24:36, Dave wrote: > > Thanks for this, it seems to be saying there is no need for a separate Window > Subclass and that the Window Controller Subclass contains all the code needed > to drive the window. I’m a bit confused of when to use an NSWindow and when > to use and

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Ken Thomases
On Feb 16, 2015, at 9:24 AM, Dave wrote: >> I recommend that you follow the advice in this article: >> . > > Thanks for this, it seems to be saying there is no need for a separate Window > Subclass and tha

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Dave
Hi Ken, Thanks for this, it seems to be saying there is no need for a separate Window Subclass and that the Window Controller Subclass contains all the code needed to drive the window. I’m a bit confused of when to use an NSWindow and when to use and NSWindowController? The way I had thought

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Ken Thomases
On Feb 16, 2015, at 8:17 AM, Dave wrote: > I’ve just started a new Application and I”m wondering what the best/standard > way of setting it up. I recommend that you follow the advice in this article: . Ch