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: Darrin Cardani <email@hidden>
- Date: Sat, 12 Jun 2004 20:43:53 -0500
At 5:38 PM -0700 6/12/04, "Jonathan 'Wolf' Rentzsch" <email@hidden> wrote:
I'm mocking up a UI that uses an NSOutlineView. I'd like a single column
to be able to hold two editable text fields. Something like this ASCII
art:
+------------------------+
one NSTableColumn >> | Description/Start+Stop |
+------------------------+
| > closed description |
lame disclosure arrow art >> | V opened description |
one NSCell, enclosing two >> | 1:00pm | 2:33pm |
| > closed description |
| > closed description |
+------------------------+
Has anyone done something like this before? Is it feasible?
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. 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.
Darrin
--
Darrin Cardani - email@hidden
President, Buena Software, Inc.
<
http://www.buena.com/>
Video, Image and Audio Processing Development
_______________________________________________
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.