NSTextView: displaying "virtual" symbols?
NSTextView: displaying "virtual" symbols?
- Subject: NSTextView: displaying "virtual" symbols?
- From: David Young via Cocoa-dev <email@hidden>
- Date: Mon, 1 Nov 2021 14:26:25 -0500
- Mail-followup-to: email@hidden
[resending with an even smaller attachment]
I am working on a document storage format that consists of logical zones
that nest. You can think of them sort of like <div> elements from
(X)HTML:
<div id="foo"><div id="bar">All work and no play.</div></div>
Ordinarily, I would like for the zone boundaries marked by <div> and
</div> to be invisible to the user. Ordinary cursor motion commands
should step from character to character, ignoring the <div> boundaries.
However, I also want to offer a display & editing mode to the user where
they can see the boundaries and use special cursor motion commands to
"creep" the cursor across the boundaries. In this mode, there are
additional locations addressable by the cursor. I have marked those
locations with a pipe (|):
|<div id="foo">|<div id="bar">All work and no play.</div>|</div>|
I took the attached screenshot in Numbers. It shows roughly the visual
effect I'm looking for. Incidentally, it's possible to move the cursor
back and forth over the crescent that "closes" the AVERAGE function
cell. That's good. It is also possible to delete the crescent, which
is neither necessary nor desirable for my purposes, but I guess that I
could accept it.
It would be nice if I could accomplish this effect without introducing
characters to my NSTextStorage.
It looks like TextKit 2 lets one do something like this rather easily,
but I'm leary of adopting it while it's so green.
Is anyone aware of a "worked example" I can read for TextKit 1?
Dave
--
David Young
email@hidden Urbana, IL (217) 721-9981
Attachment:
Screen Shot 2021-10-30 at 8.53.38 PM.jpg
Description: JPEG image
_______________________________________________
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