• 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
How to save/restore the screen of the window in user defaults?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to save/restore the screen of the window in user defaults?
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Re: MVC design Q - remembering Core Data selections
  • Next by Date: Re: MVC design Q - remembering Core Data selections
  • Previous by thread: Re: What is the equivalent of SetSystemUIMode() in Leopard and above?
  • Next by thread: Re: How to save/restore the screen of the window in user defaults?
  • Index(es):
    • Date
    • Thread