• 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: Guy Umbright <email@hidden>
  • Date: Wed, 11 Jan 2006 09:17:41 -0600

And that was the problem.  Only the clicked button highlights now.

Thanks again.

Guy

On Jan 10, 2006, at 9:31 PM, Guy Umbright wrote:

Corbin,

Of course, that would make sense. That was bothering me that if there is only one cell instance
how would they behave differently? I will implement the copyWithZone and post the result (so it
is in the archives. Thank you so much.


As for the memory leak, its first cut code but thanks for pointing it out.

Ron: Sorry to have not responded but somehow I never got your response. Thanks.

Guy

On Jan 10, 2006, at 6:34 PM, Corbin Dunn wrote:

On Jan 7, 2006, at 3:46 PM, Ron Wilson wrote:

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.

Just to correct this a little bit. Before tracking occurs, the cell is copied. That way, it can reflect a state that is different from all other cells being drawn. Because m_ButtonCell and the other ivars are not copied (since copyWithZone: isn't implemented), the copied cell will be using the other ivars; they themselves should be copied.


Also, the code shown has a memory leak. If, in dealloc, [_mButtonCell release] was called, eventually there would be crash, since the ivar instances would be copied, but not retained, and the extra release would overrelease and crash. Does this make sense? if not, i can elaborate.

-corbin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40kickstandsoft.com


This email sent to email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40kickstandsoft.com


This email sent to email@hidden



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

  • Prev by Date: Problems inserting into an ArrayController
  • Next by Date: Re: Getting WebView and JavaScript to communicate. MFC can do it.
  • Previous by thread: Re: Why do all subcell buttons highlite for custom cell in NSTableView?
  • Next by thread: Why do all subcell buttons highlite for custom cell in NSTableView?
  • Index(es):
    • Date
    • Thread