• 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: NSCursor problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCursor problem


  • Subject: Re: NSCursor problem
  • From: "Sean McBride" <email@hidden>
  • Date: Thu, 30 Nov 2006 18:07:15 -0500
  • Organization: Rogue Research

On 2006-11-30 13:14, Sarah Dumoulin said:

>- (void) resetCursorRects {
>	[super resetCursorRects];
>	if (currentCursor != nil && currentCursor != [NSCursor arrowCursor]) {
>		[self addCursorRect:[self visibleRect] cursor: pointerCursor];
>	} else if (currentCursor != nil) {
>		[self addCursorRect:[self visibleRect] cursor:arrowCursor];
>	}
>}
>
>My code gets to the setCursor, and resetCursorRects is called, but
>doesn't work as expected.  I realise that the calls to
>resetCursorRects in the setCursor functions should be unecessary, but
>in practice invalidateCursorRectsForView only causes resetCursorRects
>to be called the very first time I change the cursor.  On subsequent

Might you be seeing this?
<http://www.cocoabuilder.com/archive/message/2002/10/22/70852>

Basically, if your resetCursorRects does not add at least 1 cursor rect
(which yours might do), things behave badly.  I don't remember the
details, but I have this in all my projects:

- (void)resetCursorRects
{
 if (blah)
  [self addCursorRect:...]

 etc.

	// This is here so there will always be at least one cursor rect.
	// If there isn't, invalidateCursorRectsForView: does not work reliably
	// <rdar://4130594>
	[self addCursorRect:NSMakeRect(0.0f, 0.0f, 1.0f, 1.0f) cursor:[NSCursor
arrowCursor]];
}

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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

References: 
 >NSCursor problem (From: Sarah Dumoulin <email@hidden>)

  • Prev by Date: Re: NSTreecontroller outline view selectedObjects is empty
  • Next by Date: Editing strings in view
  • Previous by thread: NSCursor problem
  • Next by thread: Getting the text out of iWork Pages file
  • Index(es):
    • Date
    • Thread