• 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
Notification when display resolution changes?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Notification when display resolution changes?


  • Subject: Notification when display resolution changes?
  • From: Gabriel Zachmann <email@hidden>
  • Date: Mon, 31 Aug 2009 01:45:57 +0200

Is there a way to have my Cocoa app get notified when the display resolution changes? (while my app is running)

The reason is that I am trying to make the window of my app always as large as the screen.
Currently I do that in the init method of my window with


	NSRect visibleFrame = [[self screen] visibleFrame];
	[self setFrame: visibleFrame display: YES];

However, when the screen resolution changes (for instance, because I've plugged in a projector), then the window is too big.

I guess I could do setFrame: every time in the draw: method of my view -- but would that be the proper way to do it?

I tried to find an answer to this question in the documentation, but failed.

Any pointers will be highly appreciated.

Best regards,
Gabriel.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: Notification when display resolution changes?
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Async NSURLConnection + Concurrent NSOperation = Not possible under Mac OS X 10.6?
  • Next by Date: Re: Notification when display resolution changes?
  • Previous by thread: Remote host issue with Xcode 3.x
  • Next by thread: Re: Notification when display resolution changes?
  • Index(es):
    • Date
    • Thread