Manually drawing caret
Manually drawing caret
- Subject: Manually drawing caret
- From: Andrew Pontious <email@hidden>
- Date: Wed, 11 Jan 2006 23:41:39 -0800
The home project (http://umbar.com/Neutrino) I'm working on has a
cross-platform engine that wants to lay out all the text and graphics
in its window, so I can't use NSTextView, but I still want it to look
like a native text view.
I've worked out how to display the selected text using the system
colors, but I still have the problem of displaying the text insertion
caret.
I could just manually draw something that currently would exactly
match the caret in the shipping OS (10.4), but I was wondering if
there wasn't a way that would use more of the system APIs, so I'd be
at least cushioned against future style and measurement changes.
- I could position a clear-background NSTextView *over* my custom view
solely for its blinking caret. This seems...fiddly.
- I could just draw a 1-pixel line. The ATSUI documentation seems to
indicate that this is kosher: it has a *lot* of space devoted to
finding the right cursor position, but for drawing it recommends a
simple MoveTo()/LineTo() combo. I'm not using any ATSUI APIs right
now, I'm just using the Cocoa APIs.
Any thoughts?
Thanks
-- Andrew Pontious
_______________________________________________
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