[comp.sys.mac.programmer] TEDeactivate won't remove the caret?

pers@ifi.uio.no (Per Siljubergs}sen) (04/24/91)

I have different TextEdit fields in a window. Only a
single field should get the user's attention at any one
time. So, when the user types a tab my applcation calls
TEDeactivate for the last used TextEdit field and
TEActivate for the next field.

But a non-blinking caret is still visible in the first
field. Often this frozen caret appeares when the window
is in the background too. The application calls TEActivate,
TEDeactivate and TEIdle as suggested in IM I, I believe.

I think TextEdit inverts the caret within TEIdle, and I there
are indications that TE thinks the caret is visible when it's
invisible and invisible when it's visible..

What's really the problem here? How do I get rid of the caret?


--
Per Siljubergsaasen (pers@ifi.uio.no)

kaufman@neon.Stanford.EDU (Marc T. Kaufman) (04/24/91)

In article <1991Apr24.011611.662@ifi.uio.no> pers@ifi.uio.no (Per Siljubergs}sen) writes:

...
.But a non-blinking caret is still visible in the first
.field. Often this frozen caret appeares when the window
.is in the background too. The application calls TEActivate,
.TEDeactivate and TEIdle as suggested in IM I, I believe.

.What's really the problem here? How do I get rid of the caret?

Make sure the clipRgn encompasses the active window when Deactivating.
If it doesn't, TextEdit will do a final invert to clear the caret, but
it won't happen on the screen.

Marc Kaufman (kaufman@Neon.stanford.edu)