Re: Modifying NSTableView cell data just prior to invoking field editor
Re: Modifying NSTableView cell data just prior to invoking field editor
- Subject: Re: Modifying NSTableView cell data just prior to invoking field editor
- From: Alastair Houghton <email@hidden>
- Date: Fri, 1 May 2009 10:50:07 +0100
On 1 May 2009, at 04:49, Jim Correia wrote:
On Thu, Apr 30, 2009 at 11:38 PM, K. Darcy Otto <email@hidden>
wrote:
Option 2: Moving the text displayed by the NSTableView to the right
by some
way other than inserting spaces. This might be the best way,
alleviating
the need for a custom field editor and editing the field editor
text prior
to display. I'm not really sure how to do this though.
So you are inserted spaces into the value to achieve an fixed width
indent?
Subclass NSTextFieldCell, and override -titleRectForBounds: to add
your left padding.
That's very likely the best method in this specific case, but it's
also worth mentioning that if you want the normal display to be
different from what the user gets to edit, you can use a custom
NSFormatter subclass, together with NSFormatter's -
editingStringForObjectValue: method.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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