• 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
Subclassing NSWindowController for multi-window NSDocument?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subclassing NSWindowController for multi-window NSDocument?


  • Subject: Subclassing NSWindowController for multi-window NSDocument?
  • From: Keith Blount <email@hidden>
  • Date: Mon, 27 Dec 2004 16:48:20 -0800 (PST)
  • Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys

Hello,

I know the question I am asking is on the trivial
side, but even after reading the docs on
NSWindowController, NSDocument and the document
architecture, I am still nonplussed. The question:

I have a document-based app that contains an outline
view and a text view, a bit like Xcode. Clicking an
item in the outline view opens it in the text view.
And like in Xcode, I want it so that if you
double-click on the item, it opens in a new window,
and the title of this new window will appear in the
app's 'Window' menu as a sub-item of the main window
title.

Do I need to subclass NSWindowController to achieve
this? Basically, if the user double-clicks on an item,
it should open in the new window, but if the user then
flicks back to the main window and double-clicks on
another item, that should open in the already-open
extra window (ie. exactly like in Xcode). Do I need to
have an NSWindowController subclass as the file's
owner instead of my NSDocument subclass for this? If
so, do I need to move all of my outlets and actions
from MyDocument into an NSWindowController subclass?
And how do I make sure my main document window still
loads as normal, but my other window loads when I
want? I am totally baffled by the whole process of
achieving this, even though it seems as though it
should be really simple. All the books I have cover
only document-based apps with one window and only
discuss subclassing NSWindowController in relation to
creating a preferences window (which is application-
rather than document-based), but from reading the docs
and searching the archives, it seems this is what I
need to do to get what I want - I just don't know how
to relate this to my already-created NSDocument
subclass.

If anyone could point me in the direction of any
really easy-to-understand info or tutorials, or just
give me some tips, I would be really grateful.

Many thanks,
Keith

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Reserved NSEvent keys
  • Next by Date: Re: NSApplicationSupportFolder
  • Previous by thread: Re: Reserved NSEvent keys
  • Next by thread: Re: Subclassing NSWindowController for multi-window NSDocument?
  • Index(es):
    • Date
    • Thread