• 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
Custom mouse cursor in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Custom mouse cursor in NSTextView


  • Subject: Custom mouse cursor in NSTextView
  • From: Todd Ransom <email@hidden>
  • Date: Fri, 13 Jun 2008 11:58:45 -0400

Hi All,

I have a fullscreen text view in my app that allows the user to set a foreground and background color. Problem is, for some configurations the default I-beam mouse cursor does not show up very well so I want to provide a custom I-beam cursor in the same color as the text.

I put together a bezier path to draw the I-beam and overrode resetCursorRects like this:

- (void)resetCursorRects
{
	[self addCursorRect: [self visibleRect] cursor: [self bigIBeamCursor]];
}


This works great as long as I use it in an NSView subclass. But as soon as I change my class to inherit from NSTextView it stops working. resetCursorRects is still called, but the text view is doing some kind of magic to change the cursor itself. I have also tried overriding - (void)addCursorRect:(NSRect)aRect cursor:(NSCursor *)aCursor to replace the generic ibeam with my own, but that only seems to get called if I override resetCursorRects and it does not affect the cursor appearance in the text view either.


Has anyone else out there successfully changed the mouse cursor on a text view? What did you need to do?

thanks,
Todd Ransom
Return Self Software
http://returnself.com



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Custom mouse cursor in NSTextView
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: Geographic Location drag type
  • Next by Date: [NSOutlineView/NSTableView] Returning nil enables auto-edition?
  • Previous by thread: Re: Geographic Location drag type
  • Next by thread: Re: Custom mouse cursor in NSTextView
  • Index(es):
    • Date
    • Thread