Re: Why do all subcell buttons highlite for custom cell in NSTableView?
Re: Why do all subcell buttons highlite for custom cell in NSTableView?
- Subject: Re: Why do all subcell buttons highlite for custom cell in NSTableView?
- From: Ron Wilson <email@hidden>
- Date: Sat, 7 Jan 2006 15:46:33 -0800
On Jan 7, 2006, at 3:14 PM, Guy Umbright wrote:
I have a custom cell (CustomCell.m source below) that consists of
two subcells, a button end edit cell.
When used in an NSTableView with multiple rows, when I press the
button, ALL instances of the button
subcell hilight, rather than just the one I am pressing.
- (void) drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)
controlView
{
[self _CalcSubCellFrames:cellFrame];
[m_editCell drawWithFrame:m_editFrame inView:controlView];
[m_buttonCell drawWithFrame:m_buttonFrame inView:controlView];
}
Your drawInteriorWithFrame will draw the m_buttonCell with it's
current settings.
- (BOOL) startTrackingAt: (NSPoint) startPoint inView:(NSView*)
controlView
{
if (NSMouseInRect(startPoint, m_buttonFrame,NO) == YES)
{
[m_buttonCell highlight:YES withFrame:m_buttonFrame
inView:controlView];
The state of m_buttonCell is now highlighted.
[self _RunPanel];
Before this next statement, drawInteriorWithFrame must be being
called for all the table rows and hence all the buttons will be drawn
highlighted. Try logging the calls to drawInteriorWithFrame or set a
breakpoint to see that this is in fact happening.
[m_buttonCell highlight:NO withFrame:m_buttonFrame
inView:controlView];
}
...
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden