• 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
Re: White caret cursor, how to do it?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: White caret cursor, how to do it?


  • Subject: Re: White caret cursor, how to do it?
  • From: Greg Herlihy <email@hidden>
  • Date: Sun, 19 Mar 2006 19:13:57 -0800
  • Thread-topic: White caret cursor, how to do it?

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: White caret cursor, how to do it?
      • From: "I. Savant" <email@hidden>
References: 
 >White caret cursor, how to do it? (From: Dominik Wagner <email@hidden>)

  • Prev by Date: Second Window Leak
  • Next by Date: Re: NSString propertyList crash
  • Previous by thread: White caret cursor, how to do it?
  • Next by thread: Re: White caret cursor, how to do it?
  • Index(es):
    • Date
    • Thread