• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: doubling up a NSCell for an NSTableColumn
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: doubling up a NSCell for an NSTableColumn


  • Subject: Re: doubling up a NSCell for an NSTableColumn
  • From: Joshua Moody <email@hidden>
  • Date: Wed, 15 Nov 2006 23:32:31 -0800

Darrin Cardani, <email_removed>, 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.

I've followed your suggestion and subclassed NSActionCell as you suggested, but I'm struggling with the details.

If you need more details, let me know.

Could you provide an example? The drawing, editing, and selecting portions are where I am having trouble.

Many thanks,

jjm


FROM : Jonathan 'Wolf' Rentzsch
DATE : Sun Jun 13 05:32:53 2004

Darrin Cardani, <email_removed>, 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.

_______________________________________________ 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
References: 
 >Re: CFRunLookFindMode crash (From: Martin Redington <email@hidden>)
 >Fwd: CFRunLookFindMode crash (From: Martin Redington <email@hidden>)
 >Re: CFRunLoopFindMode crash (was CFRunLookFindMode crash) (From: Martin Redington <email@hidden>)

  • Prev by Date: Re: CoreData, reset a persistent store
  • Next by Date: Re: How To Create Very Huge Images (2 GB and above)
  • Previous by thread: Re: CFRunLoopFindMode crash (was CFRunLookFindMode crash)
  • Next by thread: Re: CFRunLookFindMode crash
  • Index(es):
    • Date
    • Thread