• 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
question about custom cursor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question about custom cursor


  • Subject: question about custom cursor
  • From: Fred Hope <email@hidden>
  • Date: Sat, 3 Mar 2007 21:43:44 -0800

Hi everyone. I'm writing a text+graphic adventure game that uses a custom NSCursor object whenever the cursor is within the graphic view (a subclass of NSImageView). It's working okay; the only problem is that when text is printed (to the adjacent NSTextView), for example if the user clicks on something which causes text to be printed, the cursor reverts to the standard black arrow, and the user must move the cursor out of the graphics region and back in, to see the custom cursor again.

My text-printing method is this:

- (void)showIt:(NSString *)outputString
{
NSRange selectionRange = NSMakeRange([[txtView textStorage] length], 0);
[txtView setEditable:YES];
[txtView setSelectedRange:selectionRange];
[txtView insertText:outputString];
[txtView setEditable:NO];
}


And through trial and error, I narrowed it down to the two setEditable calls; one of them alone is ok, but having both, regardless of the code between them, messes up the cursor. E.g., simply setting it editable and printing the text is fine; it's the follow-up setEditable:NO that changes the cursor. What's the fix for this? I tried putting [cursor set] (where cursor is my custom cursor) at the end of that, but that didn't work.

Thanks for any help,
Fred
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: question about custom cursor
      • From: Alastair Houghton <email@hidden>
  • Prev by Date: Re: Connections between a text field and an instance variable do not work
  • Next by Date: Re: Subclass of NSMutableDictionary hanging
  • Previous by thread: Re: Connections between a text field and an instance variable do not work
  • Next by thread: Re: question about custom cursor
  • Index(es):
    • Date
    • Thread