Solved: Cells within cells and mouse tracking
Solved: Cells within cells and mouse tracking
- Subject: Solved: Cells within cells and mouse tracking
- From: Pete Yandell <email@hidden>
- Date: Tue, 22 Jul 2003 11:35:42 +1000
Thanks to a couple of people who replied I have this sorted out.
It turns out that NSButtonCell's trackMouse:inRect:ofView:untilMouseUp:
method doesn't do any highlighting of the button on its own. You have
to call highlight:withFrame:inView yourself to get the correct
behaviour, so my code now looks like this:
- (BOOL)trackMouse:(NSEvent*)event inRect:(NSRect)cellFrame
ofView:(NSView*)controlView untilMouseUp:(BOOL)untilMouseUp
{
[buttonCell highlight:YES withFrame:cellFrame inView:controlView];
BOOL result = [buttonCell trackMouse:event inRect:cellFrame
ofView:controlView untilMouseUp:untilMouseUp];
[buttonCell highlight:NO withFrame:cellFrame inView:controlView];
return result;
}
I've still got a few kinks to iron out. Slightly weird things happen
when you click too quickly, and getting the results of the button click
back to my outline view's data source is proving to be a problem, but
I'll see if I can sort those out on my own.
Pete Yandell
http://pete.yandell.com/
_______________________________________________
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.