• 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: Coordinate system question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coordinate system question


  • Subject: Re: Coordinate system question
  • From: email@hidden
  • Date: Tue, 19 Mar 2002 16:53:47 -0800

@implementation NSWindow (WindowCentering)
- (void)centerOnScreen:(NSScreen *)screen

...or how to invent a wheel:

=== NSWindow.html ===
center

- (void)center

Sets the receiver's location to the center of the screen. The receiver is placed exactly in the center horizontally and somewhat above center vertically. Such a placement carries a certain visual immediacy and importance. This method doesn't put the receiver on screen, however; use makeKeyAndOrderFront: to do that.

You typically use this method to place an NSWindow-most likely an attention panel-where the user can't miss it. This method is invoked automatically when an NSPanel is placed on the screen by NSApplication's runModalForWindow: method.
=== end ===

;)))

Yeah, but mine is multiple-monitor-ready. :->
Actually, I wrote mine just a few days ago, and I could swear I looked for such a method before I did it myself. Sigh. Well, they just granted a guy in Australia a patent on the wheel (really!), so now I guess I can be sued for reinventing it. :->

Ben Haller
Stick Software
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Coordinate system question (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: Coordinate system question
  • Next by Date: debugging a System Preferences pane
  • Previous by thread: Re: Coordinate system question
  • Next by thread: Re: Coordinate system question
  • Index(es):
    • Date
    • Thread