• 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
Finding bounding rect of substring inside a wrapped string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Finding bounding rect of substring inside a wrapped string


  • Subject: Finding bounding rect of substring inside a wrapped string
  • From: Dave DeLong <email@hidden>
  • Date: Sat, 03 Jan 2009 12:33:39 -0700

Hi everyone,

The title basically says it. I have a string (not very long; less than 150 characters) that is wrapped inside an NSTextField (a label). I want to find the bounding rects of a couple substrings, so that I can overlay them with an NSButton. I've been searching around, and I've found a promising lead with NSLayoutManager's "- boundingRectForGlyphRange:inTextContainer:", but I've never used an NSTextContainer before and am not sure how they work.

Would this be the proper way to do it? How can I create an NSTextContainer that contains a string?

Any pointers are greatly appreciated.

Thanks!

Dave DeLong
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Problems with object observing own key
  • Next by Date: Finding bounding rect of substring inside a wrapped string
  • Previous by thread: Re: Problems with object observing own key
  • Next by thread: Finding bounding rect of substring inside a wrapped string
  • Index(es):
    • Date
    • Thread