NSTextAttachment, MouseOver, GlyphPosition
NSTextAttachment, MouseOver, GlyphPosition
- Subject: NSTextAttachment, MouseOver, GlyphPosition
- From: Peter Krajčík <email@hidden>
- Date: Sat, 19 Feb 2011 18:49:01 +0100
Hi,
I have subclassed NSTextAttachment/NSAttachemntCell pair and I need to implement mouseOver.
NSTextAttachment are inserted programatically to NSTextField's NSAttributedString object, displayed correctly
and I can manipulate them.
I have found not very elegant way how to create and track NSTrackingArea for each NSTextAttachment character in
NSTextField, but I am not happy with the way how I am getting NSRect representing NSTextAttachment.
What is a proper way to get cellFrame for NSTextAttachmentCell (or to be more general, position of glyph in NSAttributedString) that is inserted to NSAttributedString or drawn by NSTextFieldCell?
I think could use NSLayoutManager that could return a glyph position I could use as origin to calculate cellFrame, but
I have no idea how to get NSLayoutManager from NSTextField | NStextFieldCell | NSAttributted object.
Thank you.
Peter
_______________________________________________
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