• 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: [NSEvent locationInWindow]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Default Button and NSTextView Problem
  • Next by Date: Design-Question for Distributed Objects
  • Previous by thread: Re: [NSEvent locationInWindow]
  • Next by thread: ANN: TFM 1.0b3, dev doc/src search & viewing tool
  • Index(es):
    • Date
    • Thread