Restraining window movement + gridding
Restraining window movement + gridding
- Subject: Restraining window movement + gridding
- From: Rolf <email@hidden>
- Date: Thu, 16 Oct 2003 01:40:35 +0200
Hi,
I need to restrain window movement in my app as follows:
- Gridding: It must only allow to have origins that are evenly divisible by X, for example 0,4,8,12, etc.
- Restrain: No sides are allowed to move outside of visible screen area.
I assume a possible solution to this is using NSWindowWillMoveNotification. However the following does not work (windowWillMove is never called), and I don't understand why:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(windowWillMove:)
name:@"NSWindowWillMoveNotification" object:self];
- (void)windowWillMove:(NSNotification *)aNotification
{
NSLog(@"windowWillMove: %@",aNotification);
}
The solution must be compatible with OS X 10.1 and up.
Anybody know how to do this ?
Thanks
/Rolf
_______________________________________________
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.