• 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: Getting updated insertion point from NSDraggingInfo
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting updated insertion point from NSDraggingInfo


  • Subject: Re: Getting updated insertion point from NSDraggingInfo
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 30 Apr 2004 09:59:54 -0700

On Apr 30, 2004, at 6:59 AM, Jeremy Dronfield wrote:

I've tried overriding -draggingUpdated:, but can't figure out a way to get the updated insertion point from the NSDraggingInfo passed into the method. -draggingLocation seems to be no use, since it returns an NSPoint in the window's coordinate system.

What the text view does is to take that point in the window's coordinate system, convert it into the view's coordinate system, then into the container's coordinate system, and get a glyph index for that point; then it converts this to a character index, and sets the selected range accordingly. We don't have all of this packaged up for you in a single method--perhaps we should--but it can be done using public API. (Note that we also look at the fractional distance through the glyph, and if it's greater than 0.5, we round up.)

Douglas Davidson
_______________________________________________
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.


References: 
 >Getting updated insertion point from NSDraggingInfo (From: Jeremy Dronfield <email@hidden>)

  • Prev by Date: Re: Getting updated insertion point from NSDraggingInfo
  • Next by Date: Re: Setting resolution of images in NSTextView - [SOLVED?]
  • Previous by thread: Re: Getting updated insertion point from NSDraggingInfo
  • Next by thread: Icons in popups with controller layer
  • Index(es):
    • Date
    • Thread