about trackingArea & cursorUpdate
about trackingArea & cursorUpdate
- Subject: about trackingArea & cursorUpdate
- From: BirdSong <email@hidden>
- Date: Thu, 25 Dec 2008 02:52:21 +0000
- Importance: Normal
Hi all,I have a background application and now want to change cursor image over different types of views. I create a NSTrackingArea with option (NSTrackingCursorUpdate | NSTrackingActiveAlways) and add the tracking area to my customer view. Also, I rewrite the -(void)cursorUpdate:(NSEvent *)event method and set the cursor image there. However, when I run this background app, I find the cursorUpdate method is called(judging from the log info) but the cursor image isn't been updated. Does anyone have experience about it? Did I miss anything? Here is my code:#import "ContentView.h"
@implementation ContentView
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {
trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds] options: (NSTrackingCursorUpdate | NSTrackingActiveAlways) owner:self userInfo:nil]; [self addTrackingArea:trackingArea];
}
return self;
}
- (void)cursorUpdate:(NSEvent *)event {
NSLog(@"cursorUpdate");
[[NSCursor crosshairCursor] set];
}Thanks in advance !
_________________________________________________________________
微软地图率先推出跨城市多点驾车路线查询!
http://ditu.live.com/?form=MRAHAB&rtp=pos.30.454167_116.308611_太湖__~pos.29.554046_115.983427_庐山__~pos.29.116111_110.478889_张家界__&rtop=0~0~0&encType=1
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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