Skip navigation.
 
mlRe: ButtonCell with Text in OutlineView
FROM : David
DATE : Fri May 16 22:32:30 2008

Is there a document which describes how columns interact with enclosed cells
when dealing with bindings?

There's a message flow going on that I'm not aware of. setObjectValue is
passed different things for the same binding depending on if my class
subclasses NSTextFieldCell or NSButtonCell. I don't see a way to fake it out
without seeing more of the message flow. Too bad the source code isn't
available. In the Java world, if worse comes to worse you can read the
source to understand how framework classes interact.

I've also read about a delegate method on
NSOutlineView, outlineView:willDisplayCell:forTableColumn:item:
Is this a more appropriate way to solve the problem? Should I be able to
modify the title of a button cell through this delegate method?

On Fri, May 16, 2008 at 1:58 AM, Kyle Sluder <
kyle.sluder+<email_removed> <kyle.sluder%<email_removed>>> wrote:

> On Thu, May 15, 2008 at 1:39 PM, David <<email_removed>> 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
>

Related mailsAuthorDate
mlButtonCell with Text in OutlineView David May 15, 19:39
mlRe: ButtonCell with Text in OutlineView Kyle Sluder May 16, 07:58
mlRe: ButtonCell with Text in OutlineView David May 16, 22:32