Re: question about custom cursor
Re: question about custom cursor
- Subject: Re: question about custom cursor
- From: Fred Hope <email@hidden>
- Date: Tue, 6 Mar 2007 20:47:29 -0800
Hi Alastair, thanks for the reply.
I alloc+init my cursor with this line:
cursor = [[NSCursor alloc] initWithImage:[NSImage
imageNamed:@"cursor.tiff"] hotSpot:NSMakePoint(8,0)];
And I set the cursor's rect and such here (I have the custom cursor
appear when the mouse enters the image view, and the arrow cursor
returns when the mouse exits the view):
NSRect rect = NSMakeRect(0, 0, WINDWIDTH-1, WINDHEIGHT-1);
[imgView addCursorRect:rect cursor:cursor];
[imgView addTrackingRect:rect owner:cursor userData:nil
assumeInside:NO];
[imgView addCursorRect:rect cursor:[NSCursor arrowCursor]];
[imgView addTrackingRect:rect owner:[NSCursor arrowCursor]
userData:nil assumeInside:NO];
[cursor set];
[cursor setOnMouseEntered:YES];
[[NSCursor arrowCursor] setOnMouseExited:YES];
The [cursor set] call here may be unnecessary. In any case, is there
a problem with how I've set up the cursor, or is there some method I
can call at the end of the function that prints text (like I said,
the problem is with the final [textField setEditable:NO] call).
-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