• 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: Document based apps & tabbed windows?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Document based apps & tabbed windows?


  • Subject: Re: Document based apps & tabbed windows?
  • From: Seth Willits <email@hidden>
  • Date: Mon, 16 Apr 2007 08:09:08 -0700

On Apr 16, 2007, at 6:48 AM, Timothy Reaves wrote:

One approach I was considering was to (as one responder posted, but
not to the list) intercept calls for new windows, and add the document
making the request to a collection in the one MyDocument window
controller. That collection would be used to populate the tab titles.
When one of the tabs was selected, display it.


This isn't the same as calling setDocument:. But will it work? I'll
spike it in an example app when I can, but first wanted to see if
anyone could/would offer some advice.

Well let me (quickly, because I'm late) elaborate on what I meant because it sounds like you figured out the half that I left out. When a new document is created and makeWindowController: is called, you'd create a window controller for your document. When creating another document, you don't create a window controller but just add it to an array in the existing window controller. To make it current for that window you'd call setDocument: (which changes the name in the Window menu, window title bar, changes the state of the close button in the window, changes which undo manager is hooked up, etc etc) whenever you switch between them. I'd make an example too (and have been meaning too), but I have to go take an exam. Hopefully this is enough to make more sense.




I guess the thing to consider is what a document based app provides.
It sounds as if your saying perhaps it didn't provide enough for the
effort.

Pretty much. When I started, I was a lot greener with Cocoa and what the document architecture does is quite a lot, but looking back at it now, it's not _that_ much, and given the ease of which you can write things in Cocoa, it probably wouldn't take too long to get the behavior it offers.




  One thing I'm still unsure about is what are the benefits.
I've read all the Apple documents on document based apps, and it
really seems that not as much was provided as perhaps I'd thought.

Right, though if you're doing a one-doc-per-window app, it's pretty cool that you don't have to do anything to make it all work. :)




--
Seth Willits



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >Document based apps & tabbed windows? (From: Timothy Reaves <email@hidden>)
 >Re: Document based apps & tabbed windows? (From: Seth Willits <email@hidden>)
 >Re: Document based apps & tabbed windows? (From: "Timothy Reaves" <email@hidden>)

  • Prev by Date: Re: display NSXMLDocument with NSOutlineView and NSTreeController
  • Next by Date: Re: [SOLVED] Retrieving URL from NSImage
  • Previous by thread: Re: Document based apps & tabbed windows?
  • Next by thread: Re: Document based apps & tabbed windows?
  • Index(es):
    • Date
    • Thread