Re: Subclassing NSWindowController for multi-window NSDocument?
Re: Subclassing NSWindowController for multi-window NSDocument?
- Subject: Re: Subclassing NSWindowController for multi-window NSDocument?
- From: Harilaos Skiadas <email@hidden>
- Date: Tue, 28 Dec 2004 12:15:26 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
--- Keith Blount <email@hidden> wrote:
> Many thanks for your reply - your suggestion worked
> perfectly! It was all much simpler than I thought,
> as,
> like you said, I didn't have to do much to the main
> document other than add a pointer to the window
> controller for the extra window.
This is the nice thing about Cocoa, that there usually
is a simple answer to any problem, once you think
about it the right way.
>
> Incidentally, I just realised that I have Xcode in
> single-window editor mode which is why it works like
> that for me but not you... I think it may make more
> sense for my app to open as many extra windows as
> the
> user wants, though as you say, this does make things
> more complicated. I just have to sit down and work
> out
> how to swap the text storages around sensibly etc
> now.
That shouldn't be too hard either. Instead of a
pointer to a window controller, create an
NSMutableArray, and each time you need a new window
add a pointer to a window controller to this array. Of
course this way you would need to have each controller
keep an information of what it corresponds to in the
outline view, and when you double-click on something
already open it should just bring that open window
forth, after searching for it through the array. One
other way would be if there is a simple way to
associate a "code" string to each entry in your
outline view, and then instead of an array use a
mutable dictionary with the code as key. It would make
keeping track of the information on each window
easier. Then you just need to be careful about saving
for these windows, so the controller should probably
know something about the file it is responsible for.
> And having played around with the menus, indentation
> levels and what-not, I have indeed thought twice and
> decided not to spend any more time trying to
> implement
> the sub-menu thing until after my program gets to at
> least version 1.0...
The thing that I as a user would find more useful
would me something analogous to Command-`, which
cycles through all the open windows of the
application, but instead the shortcut would only cycle
through the open windows related to a particular
document. But I probably prefer shortcuts more than
most users. Just my 5c.
> Anyway, thanks again, that helped loads and saved me
> from a lot of confusion, I really appreciate it.
> All the best (and happy New Year),
> Keith
Glad to be able to help out. Good luck with the rest
of your app, and happy holidays.
Haris
__________________________________________________
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