更改跟踪区域时,未检测到事件mouseEntered

时间:2012-04-27 16:29:25

标签: objective-c xcode cocoa mouseevent nstrackingarea

我有两个跟踪区域:

NSTrackingArea * area1 = [[NSTrackingArea alloc] initWithRect:NSMakeRect(0,0,200,200) options:NSTrackingMouseEnteredAndExited|NSTrackingActiveAlways owner:self userInfo:nil];

NSTrackingArea * area2 = [[NSTrackingArea alloc] initWithRect:NSMakeRect(0,200,200,200) options:NSTrackingMouseEnteredAndExited|NSTrackingActiveAlways owner:self userInfo:nil];

我的问题是当我直接从area1到area2时,不会调用area2的“mouseEntered”方法,因为检测到的事件是来自area1的“mouseExited”。离开area1并进入area2时,我该怎么做才能检测到事件?

0 个答案:

没有答案