• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why do all subcell buttons highlite for custom cell in NSTableView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Why do all subcell buttons highlite for custom cell in NSTableView?
      • From: Corbin Dunn <email@hidden>
References: 
 >Why do all subcell buttons highlite for custom cell in NSTableView? (From: Guy Umbright <email@hidden>)

  • Prev by Date: WebView and NSTabView
  • Next by Date: Re: NSAttributedString: lossy attachments when serializing/archiving?
  • Previous by thread: Why do all subcell buttons highlite for custom cell in NSTableView?
  • Next by thread: Re: Why do all subcell buttons highlite for custom cell in NSTableView?
  • Index(es):
    • Date
    • Thread