• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Manually drawing caret
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: timeout on -[NSData dataWithContentsOfURL:] ?
  • Next by Date: [MEET] CocoaHeads/Mac dev group: MacWorld
  • Previous by thread: Re: timeout on -[NSData dataWithContentsOfURL:] ?
  • Next by thread: Creating Universal Binary - Screen Saver
  • Index(es):
    • Date
    • Thread