Re: Document based apps & tabbed windows?
Re: Document based apps & tabbed windows?
- Subject: Re: Document based apps & tabbed windows?
- From: "Timothy Reaves" <email@hidden>
- Date: Mon, 16 Apr 2007 09:48:22 -0400 (EDT)
On Mon, April 16, 2007 01:29, Seth Willits wrote:
> On Apr 15, 2007, at 9:53 PM, Timothy Reaves wrote:
>
>
>> If I create a document based XCode project, can it be coded to
>> open new documents as tabs in a single window instead of one document per
>> window? Unfortunately I can't seem to find any information on this.
>> All the information & sample code has each
>> new document opened in a new window.
>
> The entire document architecture is designed around one document per-
> window. Having multiple documents within a window is possible, but it's a
> pretty big pain if you want certain behaviors - you'll be fighting the
> document architecture all the way. I fought it and having everything
> working, but it was really quite tough, and I wonder if there was even any
> benefit to it at all. Looking back, I probably could have implemented my
> own document architecture from scratch in the same amount or only a bit
> more time.
>
> If you're going to [ab]use the document architecture already in
> Cocoa, the basic premise is to have your document's window controller
> maintain a list of documents attached to that window, and then which ever
> one should be the current document in the window, call setDocument: on the
> window controller.
>
>
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.
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. 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.
Still looking for feedback before I make a decision. Thanks!
_______________________________________________
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