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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to