How to save/restore the screen of the window in user defaults?
How to save/restore the screen of the window in user defaults?
- Subject: How to save/restore the screen of the window in user defaults?
- From: Oleg Krupnov <email@hidden>
- Date: Mon, 25 Jan 2010 15:59:30 +0200
Hi,
I'd like my app's main window to appear on the same screen where it
was last closed, on a multi-monitor Mac. How do I do this?
I checked the docs and found that I could use [[[window screen]
deviceDescription] objectForKey:@"NSScreenNumber"] as a unique
identifier that is permanent across system reboots. Good.
But how do I restore the window on that screen? The [window screen]
property is read-only. There is [window
initWithContentRect:styleMask:backing:defer:screen:], but the doc is
rather vague how to use it. So how do I change the screen where the
window is appearing? Or maybe I should simply move the window origin?
But in that case, how the coordinate systems of the different screens
are welded together?
It's especially hard for me because I don't have a multi-monitor Mac
at my disposal to experiment with.
Thanks!
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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