• 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
Converting point struct from superview to subview
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting point struct from superview to subview


  • Subject: Converting point struct from superview to subview
  • From: Ian was here <email@hidden>
  • Date: Fri, 24 Jun 2005 08:37:06 -0700 (PDT)

Hi All,


I have an NSTextView positioned within an NSView. I am
trying to get the mouse coordinates within the
NSTextView. I'm using the following code in the
NSTextView subclass:

NSPoint    p = [self convertPoint:[NSEvent
mouseLocation] fromView:[self superview]];    // Get
mouse coordinates within the NSTextView.

I'm getting some really strange coordinates. My goal
is to allow a user to double click an image in the
text view and bring up an image editor. I use the
following code to get the image's coordinates, which
seems to work OK:

[[self layoutManager]
locationForGlyphAtIndex:range.location]

This has been driving me nuts!! Any thoughtful
suggestions would be greatly appreciated. Thank you.




____________________________________________________
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
http://football.fantasysports.yahoo.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Converting point struct from superview to subview
      • From: Douglas Davidson <email@hidden>
    • Re: Converting point struct from superview to subview
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: An API for index.html contents?
  • Next by Date: What type of window for this?
  • Previous by thread: Re: An API for index.html contents?
  • Next by thread: Re: Converting point struct from superview to subview
  • Index(es):
    • Date
    • Thread