Mouse tracking an NSCell in my control
Mouse tracking an NSCell in my control
- Subject: Mouse tracking an NSCell in my control
- From: Uli Kusterer <email@hidden>
- Date: Tue, 24 Jun 2003 18:39:16 +0200
Hi,
I'm currently working on an control that does something similar as
NSMatrix, i.e. it displays NSCell objects in a certain arrangement.
Now, drawing them works fine, but I can't seem to get mouse tracking to
work. Here's what I'm doing:
- (void)mouseDown:(NSEvent *)event
{
NSPoint lastPos = [event locationInWindow];
UKDistViewItem* mouseCell = [self getItemAtPoint: lastPos];
if( [[mouseCell cell] trackMouse: event inRect:[mouseCell bounds]
ofView:self untilMouseUp:YES] )
{
NSLog(@"Cell was clicked.");
}
[self setNeedsDisplay:YES];
}
I've verified that my getItemAtPoint: method returns the correct cell
from my list, and mouseDown is called, however the pushbutton cell
doesn't actually highlight or track the mouse in any way.
I also tried calling startTrackingAt:inView: directly and calling
continueTracking: and stopTracking: from mouseDragged: and mouseUp:,
but so far, no cookie.
Any clues, pointers to mamasam discussions etc. would be greatly
appreciated.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
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.