Identical undo between two views (or one view, two windows) puzzle
Identical undo between two views (or one view, two windows) puzzle
- Subject: Identical undo between two views (or one view, two windows) puzzle
- From: Keith Blount <email@hidden>
- Date: Wed, 2 Mar 2005 05:06:07 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Hello,
I am currently trying to find the best way of running
the main view of my app in fullscreen mode. The
fullscreen part is just about sorted, but I now face
the problem of implementing undo so that it works
seemlessly between normal mode and fullscreen mode,
and I cannot seem to find a method that works.
Fullscreen works by launching a new borderless window
that has been subclassed to accept key status. My
first way of putting my view into fullscreen mode was
by creating a new view in the fullscreen window that
copied the contents of the normal mode view. On
exiting fullscreen, I would copy the contents of the
fullscreen view back into the normal mode view. This
works very nicely, except that I can find no way of
getting undo to work between the views. I would need
to find a way of making NSUndoManager think that both
views are actually the same view, so that when the
view is created in fullscreen it copies the undo stack
from the original view, and when fullscreen is ended,
the original view copies the undo stack from the
fullscreen view (does this make any sense?).
I posted about this issue a month or two back, and
someone very helpfully suggested that instead of going
this route, I should actually move the original view
into the fullscreen window when going fullscreen, and
then move it back again when fullscreen ends. This
makes sense, but I've a couple of issues. Firstly, the
fullscreen mode looks very different (colour and scale
wise), so it means I have to make a lot of changes to
the appearance of my view before sending it fullscreen
and then changing them back again on exiting
fullscreen. Not a big deal, but it means more
intermediary code. Secondly, it doesn't feel as clean
- I have had problems getting the view to fit properly
using this method, though that is no doubt just minor
errors on my part. More importantly, though, I still
haven't got undo to work between fullscreen and normal
mode using this approach, presumably because each
window has its own undo manager (I have tried
windowWillReturnUndoManager to no avail).
Does anybody have any idea of the best way to approach
this? Essentially, all I am looking to do is move or
copy one view to another window and then back to its
original window with the undo stack remaining constant
and intact throughout.
Any advice, tips or pointers would be much
appreciated.
Many thanks and all the best,
Keith
__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/
_______________________________________________
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