Re: White caret cursor, how to do it?
Re: White caret cursor, how to do it?
- Subject: Re: White caret cursor, how to do it?
- From: "I. Savant" <email@hidden>
- Date: Mon, 20 Mar 2006 08:06:46 -0500
Excellent post, Dominik and thanks for the answer Greg.
Along these lines, I have another question. How can you easily get
the "opposite" color for the background color? In other words, how do
we get the best contrasting color for a given background color?
--
I.S.
On Mar 19, 2006, at 10:13 PM, Greg Herlihy wrote:
Initialize an NSCursor with an image of a white I-beam cursor. Then
create a
cursor rect in the NSTextView to change the cursor. The code would
probably
look something like:
NSCursor * whiteIBeamCursor = [[NSCursor alloc] initWithImage:
[NSImage imageNamed:@"whiteIBeamCursor"]
hotSpot:NSMakePoint(4.0f,4.0f)];
[myTextView addCursorRect:[myTextView bounds]
cursor:whiteIBeamCursor];
[whiteIBeamCursor setOnMouseEntered:YES];
Greg
On 3/19/06 3:20 PM, "Dominik Wagner" <email@hidden> wrote:
Hi Text fans,
in SubEthaEdit we offer to turn the background black which is a
option many people use. However, there is one problem that is bugging
our users: while the caret can be turned white (which we do) for
contrast, the mouse cursor isn't turned white. I'd see this as a bug
in the TextView because if you turn the caret white, obviously the
cursor should be turned white too. However, this is the way it is so
what can I do to change the insert caret programatically for any
given textview?
I tried usiing the NNSCursorAttributeName and applying it both to the
default attributes as well as to the text that exists. Problem is
that only works in the area of the view where htere is actual text.
how do i set this cursor for the rest of the area? I tried setting
the document cursor of the scrollview via setDocumentCursor - but
sadly that gets resetted by the textview quite often.
Any suggestions?
cheers,
dom
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
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