• 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: NSOutlineView: getting index of drawn row in outlineView:willDispayCell:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView: getting index of drawn row in outlineView:willDispayCell:


  • Subject: Re: NSOutlineView: getting index of drawn row in outlineView:willDispayCell:
  • From: James Bucanek <email@hidden>
  • Date: Thu, 13 Jul 2006 08:08:20 -0700

Ilja A. Iwas wrote on Thursday, July 13, 2006:

>Hi there,
>
>depending on what row index is getting redrawn, I'd like to alter the
>appearance of the row.  The outline view also contains smart groups,
>which cause the same items to be included at several different
>locations in the outline view simultaneously.
>
>I'm altering the parameters of the cell in
>outlineView:willDisplayCell:forTableColumn:item:. Unfortunately I
>cannot use NSOutlineView's rowForItem: method, since it seems to
>return the any out of the rows for an item, which is not necessarily
>the row being redrawn.
>
>Any ideas how I could determine the index of the redrawn row from
>inside the willDisplayCell delegate method?

Not to suggest that you completely rewrite your application but ...

I've solved this in the past by creating a lightweight view object that I use for my item nodes in the outline. The view object references the original, encapsulates a lot of the model->view translation (like constructing the node's display name), and -- most importantly -- it contains a parent pointer to the super-node that owns it in the outline. This allows me to easily traverse the outline tree to find the node's context.

--
James Bucanek
 _______________________________________________
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: 
 >NSOutlineView: getting index of drawn row in outlineView:willDispayCell: (From: "Ilja A. Iwas" <email@hidden>)

  • Prev by Date: Re: Weird tabbing result... very weird
  • Next by Date: Re: Array of random, non-repeating numbers
  • Previous by thread: NSOutlineView: getting index of drawn row in outlineView:willDispayCell:
  • Next by thread: Odd redraw issue
  • Index(es):
    • Date
    • Thread