Re: [NSEvent locationInWindow]
Re: [NSEvent locationInWindow]
- Subject: Re: [NSEvent locationInWindow]
- From: Andreas Schwarz <email@hidden>
- Date: Wed, 1 May 2002 22:32:27 -0700
When I NSLog the event's desription, the location value seems normal.
When I NSLog the values of selectionRect.origin, they are either really
large or 0. This makes no sense, since the event is clearly storing the
correct values. Does anyone know what is going on with this?
You are undoubtedly doing something like
NSLog(@"x: %d, y: %d", selectionRect.origin.x, selectionRect.origin.y);
However, the values are floats, not integers, so they're coming out
garbled. Try one of these instead:
NSLog(@"x: %f, y: %f", selectionRect.origin.x, selectionRect.origin.y);
NSLog(@"x: %d, y: %d", (int)selectionRect.origin.x,
(int)selectionRect.origin.y);
NSLog(@"Origin: %@", NSStringFromPoint(selectionRect.origin));
NSLog(@"Rect: %@", NSStringFromRect(selectionRect));
Andreas
_______________________________________________
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.