"Tokenizing" NSTextView content
"Tokenizing" NSTextView content
- Subject: "Tokenizing" NSTextView content
- From: Rob Keniger <email@hidden>
- Date: Fri, 19 Jun 2009 12:32:41 +1000
Hi,
I need to display a text view which will contain HTML-like syntax and
allow the user to drag "objects" into the view.
I have been able to use NSTextAttachment to handle the display of the
dragged objects just fine, but what I want to do is restrict the user
from dragging the object anywhere except between the "tags" in the
document.
For instance, say the content of the NSTextView is this:
<tag1><tag2><tag3>
I want to allow the user to drag the object between the tags:
<tag1>[object]<tag2><tag3>
But prevent them from dragging into the text of the tag:
<tag1><ta[object]g2><tag3>
What would be the best way to handle this? Ideally, when the text view
has focus I'd also like to prevent the cursor from being placed
anywhere except between the tags, so the user can't actually edit the
content of the tags, but this is less important.
I guess what I'm looking for is a way to tokenize the content a bit
like the way NSTokenField does, but for larger amounts of text.
--
Rob Keniger
_______________________________________________
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