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

View coordinates problem


  • Subject: View coordinates problem
  • From: Arthur VIGAN <email@hidden>
  • Date: Sun, 11 May 2003 11:47:08 +0200

Hi,

I have a custom view inside an NSTabView in my main window, and I would like to change the cursor whand the mouse is over my custom view. In order to do this, I added the - (void)resetCursorRects method to my custom view, and called [[self window] resetCursorRects]; in my initWithFrame method.
Here is my - (void)resetCursorRects method:

- (void)resetCursorRects
{
NSRect viewRect = [self frame];

// create the new hand cursor
if(!sHandCursor)
sHandCursor = [[NSCursor alloc] initWithImage:[NSImage imageNamed:@"URLHandCursor"] hotSpot:NSMakePoint(5.0, 0.0 )];

[self addCursorRect:[self convertRect:viewRect toView:nil] cursor:sHandCursor];
}

The problem is that the rect in which I should have the hand cursor is absolutely not the good one. I tried different conversions for the viewRect, but each time I have a bad rect... and now I think I am lost in all this!
Does anyone know in which coordinate I have to convert my rect to have my hand cursor at the right place?

Thanks a lot in advance,

-- Arthur
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Open the mail reader to send a mail
  • Next by Date: Drawing a dimmed button cell
  • Previous by thread: Re: Open the mail reader to send a mail
  • Next by thread: How to intercept save panel?
  • Index(es):
    • Date
    • Thread