Re: ButtonCell with Text in OutlineView
Re: ButtonCell with Text in OutlineView
- Subject: Re: ButtonCell with Text in OutlineView
- From: "Kyle Sluder" <email@hidden>
- Date: Fri, 16 May 2008 01:58:20 -0400
On Thu, May 15, 2008 at 1:39 PM, David <email@hidden> wrote:
> I do not understand how the column in the NSOutlineView knows how to set the
> property to the cell. How are the cell and column related? How do they
> interact?
You bind the value of the column to a property, and then the column
loops N times, where N is the number of rows, setting the cell's value
and then drawing the cell in each row. It's non-obvious until you
really understand how the view/cell dichotomy works.
> Is this the best approach? Is there some other preferred approach to this
> common problem?
I'm hesitant to suggest this because it seems like bad form (reminds
me of the magic \t character in Windows menus that separates the menu
item name from its accelerator key) but you could probably use a
custom cell and override its -setObjectValue: method to parse your
string and then call -setTitle: as appropriate.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden