Re: Mixing controls in NSTableView
Re: Mixing controls in NSTableView
- Subject: Re: Mixing controls in NSTableView
- From: "Dmitry Savenok" <email@hidden>
- Date: Wed, 28 Dec 2005 18:34:06 +0200
- Organization: Eltima
Try to overvride -dataCellForRow:(int)row method of NSTableColumn class,
which should return the required cell.
Hi all,
I have something I would like to do with an NSTableView. I have explored
several options, including some tutorials on stepwise.com, but haven't
found
an elegant solution.
I have a simple two column NSTableView that is entirely text, which I use
for preferences. The right column can be edited and free text entered.
For some cells, however, I would like to use another control. For
instance,
when editing a colour value, I would prefer to have a NSColorWell so the
user can pick what they want graphically. Note I only want it for some: I
don't want the whole column to only have NSColorWells.
My investigations have led me to believe that the NSTableVIew delegate
with
willDisplayCell:(id)aCell would be one of the best candidates to override
what will be displayed in the cell. The stepwise tutorial (
http://www.stepwise.com/Articles/Technical/2003-12-20.01.html) focused on
enabling one to display a custom NSView inside a cell. While I'm new to
cocoa, this still seemed like overkill for what I want.
It seems I should just be able to say "instead of NSTextFieldCell, for
this
cell use something else". Even if I have to make a simple subclass of
NSCell
that wraps an NSColorWell, that would be fine.
Any recommendations?
Regards,
Luke.
_______________________________________________
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