How to force cursor rect invalidation in view subclass when value changes
How to force cursor rect invalidation in view subclass when value changes
- Subject: How to force cursor rect invalidation in view subclass when value changes
- From: "Sean McBride" <email@hidden>
- Date: Fri, 24 Sep 2004 00:30:13 -0400
I have a subclass of NSTextField and would like to change the cursor.
I've overridden resetCursorRects, and it's working well. The cursor rect
depends on the width of the text, which I'm able to determine.
The problem is that the text field value changes (via bindings) based on
what's selected in a table view. When this happens, the cursor rect
needs to be re-computed (since the string width changed).
It looks like NSWindow's invalidateCursorRectsForView is what I need, but:
1) when would I call it?
2) the docs say "Marks as invalid the cursor rectangles of aView, an
NSView in the receiver's view hierarchy, so they'll be set up again when
the receiver becomes key (or immediately if the receiver is key).", but
what if my text field never becomes key?
Thanks!
_______________________________________________
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