RE: NSTextView custom cursor
RE: NSTextView custom cursor
- Subject: RE: NSTextView custom cursor
- From: Keith Blount <email@hidden>
- Date: Wed, 1 Mar 2006 07:23:37 -0800 (PST)
Although I have never tried it myself, I believe the
method you would need to override is NSTextView's:
-drawInsertionPointInRect:color:turnedOn:
I just did a quick test in my own NSTextView subclass
like this:
- (void)drawInsertionPointInRect:(NSRect)aRect
color:(NSColor *)aColor turnedOn:(BOOL)flag
{
if (flag)
[aColor set];
else
[[self backgroundColor] set];
aRect.size.width = 10.0;
[NSBezierPath fillRect:aRect];
}
This made the insertion point a 10-point-wide
rectangle rather than the usual thin like. However, it
only had any effect while the cursor was still and
blinking - during typing, the insertion point was
still a thin line, so I'm guessing that it must also
be drawn elsewhere. It might get you started, though.
Cheers,
Keith
--- ORIGINAL MESSAGE ---
Hello there,
I'm getting nowhere with this problem I have
previously submitted here.
I'm trying to change the default cursor used in an
NSTextView while
editing some text.
I have tried the NSCursor push/pop/set methods but
nothing seems to work.
All I have succeded to do is change the color of the
insertion point.
How can I change the shape of this insertion point
cursor ?
I would like to have a totaly different one, more like
the block
cursor of Terminal.app but different :).
Any example that you could point me to or any advice
would be truly helpful.
Best regards,
Thierry.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
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