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

Re: How to save/restore the screen of the window in user defaults?


  • Subject: Re: How to save/restore the screen of the window in user defaults?
  • From: Mike Abdullah <email@hidden>
  • Date: Mon, 25 Jan 2010 14:55:29 +0000

On 25 Jan 2010, at 13:59, Oleg Krupnov wrote:

> 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?

There is a single coordinate system that encompasses all screens attached to the computer. Do not worry about the screen the window is on, just the coordinates. Easiest way to do this is tell the owning window controller to autosave the window frame.
>
> 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

_______________________________________________

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: "Paul Sanders" <email@hidden>
References: 
 >How to save/restore the screen of the window in user defaults? (From: Oleg Krupnov <email@hidden>)

  • Prev by Date: Posting notifications
  • Next by Date: Re: How to save/restore the screen of the window in user defaults?
  • Previous by thread: How to save/restore the screen of the window in user defaults?
  • Next by thread: Re: How to save/restore the screen of the window in user defaults?
  • Index(es):
    • Date
    • Thread