View coordinates problem
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.