Re: doubling up a NSCell for an NSTableColumn
Re: doubling up a NSCell for an NSTableColumn
- Subject: Re: doubling up a NSCell for an NSTableColumn
- From: "Jonathan 'Wolf' Rentzsch" <email@hidden>
- Date: Sat, 12 Jun 2004 22:32:53 -0500
Darrin Cardani, email@hidden, wrote:
>
I've done something like it. I made a single cell that has both a
>
text field and a stepper (little arrow controls). The way I did it
>
was to create a subclass of NSActionCell that contained both an
>
NSStepperCell and an NSTextFieldCell.
Ah yes. I remember telling you that's what you'd need to do at the last
PSIG :-)
>
The main functions I had to
>
override were -drawWithFrame:inView:,
>
-editWithFrame:inView:editor:delegate:event:, and the tracking
>
methods. You might not need the tracking methods, I'm not sure. In
>
-editWithFrame:..., I always have it call the text field's
>
-editWithFrame:... method, though you'll probably need to check the
>
mouse coords in the event to see which one it should call. I also had
>
to modify the rectangle I sent to the text field's edit method and
>
draw methods to only draw (or edit) in half the cell.
>
>
I also had to override -setObjectValue: and -objectValue, of course,
>
and don't forget to implement -copyWithZone:. That one bit me hard,
>
because NSOutlineView likes to make lots of copies of the cell. If
>
you need more details, let me know.
Thanks for the tips. You've just saved me lots of digging time.
| Jonathan 'Wolf' Rentzsch
http://rentzsch.com
| Red Shed Software
http://redshed.net
| "better" necessarily means "different"
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.