• 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: How do you determine where picture is in an rtfd view?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you determine where picture is in an rtfd view?


  • Subject: Re: How do you determine where picture is in an rtfd view?
  • From: Douglas Davidson <email@hidden>
  • Date: Mon, 7 Apr 2003 10:11:15 -0700

On Sunday, April 6, 2003, at 11:41 AM, Mark Ogilvie wrote:

When you create an rftd file with an image in it, how can you tell
where the image is in relation to the text?

Determining the location of an attachment in an NSTextView is similar to determining the location of an ordinary glyph. Use the NSLayoutManager to determine the glyph corresponding to the attachment character, and which text container it is laid out in (if there is more than one). Then you can ask the NSLayoutManager for the rect of the line fragment in which that glyph lies, and for the location of the glyph in that line fragment. Bear in mind that the location of the line fragment is relative to the origin of the container (which is offset from the origin of the view by the view's textContainerOrigin) and that the location of the glyph is relative to the origin of the line fragment rect. Try looking at the LayoutManagerDemo example on developer.apple.com for this.


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: 
 >How do you determine where picture is in an rtfd view? (From: Mark Ogilvie <email@hidden>)

  • Prev by Date: Re: NSBrowser delegate
  • Next by Date: Re: Sound Level
  • Previous by thread: How do you determine where picture is in an rtfd view?
  • Next by thread: StripedTableView and sheets
  • Index(es):
    • Date
    • Thread