Re: Text attachments - making an NSTextAttachment unique?
Re: Text attachments - making an NSTextAttachment unique?
- Subject: Re: Text attachments - making an NSTextAttachment unique?
- From: Martin Wierschin <email@hidden>
- Date: Thu, 27 Oct 2005 17:47:34 -0700
Hi Keith,
The problems I have seem to lie with the way that the text system
deals with attributes. The text system assumes that
text attributes don't change, and so may "merge" two
different attribute objects into the same objects
Are you taking about how characters with equal attribute
dictionaries applied are merged together into a single attribute run
(eg: effective range spans both characters)? I'm not sure that rule
applies to attachment characters, but if it does, you could just
create a subclass of NSTextAttachment that overrides isEqual to do
the right thing for your attachments.
For instance, I may create a
text attachment cell that gets highlighted when the
cursor is next to it. However, if I create two such
attachments next to each other and move the cursor
next to one of them, both will get highlighted
You had to write some code to achieve that selection behavior,
correct? If so, in that code I would ensure that you only create a
selection that spans one attachment character at a time.
~Martin
_______________________________________________
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