Re: Coordinate system question
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.