• 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: NSCell subclass editing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCell subclass editing


  • Subject: Re: NSCell subclass editing
  • From: Boris Remizov <email@hidden>
  • Date: Tue, 2 Oct 2007 20:54:00 +0400

Hi and you!
As my own way, I solve these problems by creating compound NSCells subclasses like


@interface CompoundCell: NSActionCell
{
	NSImageCell* cell1;
	NSImageCell* cell2;
	NSTextCell* cell3;
	NSButtonCell* cell4;
	InfoButtonCell* cell5;
	....
}

- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *) controlView

@end

In drawInteriorWithFrame i call the drawInteriorWithFrame methods of sub-cells with appropriate coordinates.
As about tableView:setObjectValue delegate, you may return any object from objectValueForTableColumn method with any properties, and read ones in Cell's setObjectValue method.


On Oct 2, 2007, at 17:16 , tiennou wrote:

Hi !

I'm trying to build a custom cell for inclusion in a NSTableView that should represent a file on disk. This cell shows a file icon, a file name, and a small 'change' button when hovered (I haven't got to the hovering part, since that's eye-candy IMHO). I actually have code that make it draw like I want, but I can't find a 'nice' way to handle editing.

I would like to display an NSOpenPanel when the 'change' button is clicked, and get back the new path (as an NSString) from the NSTableView delegate method - tableView:setObjectValue:..., but I haven't been able to do so.

I tried overriding NSCell - editWithFrame:inView:editor:delegate:event:, but it's never called...

One of the alternate ways I've found is to use NSApp's - sendAction:to:from: with as action a selector I add to my main window controller and sender my cell, which kinda works, but it forces me to lookup the data corresponding to the cell, which is cumbersome...


Etienne Samson

_______________________________________________

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


  • Follow-Ups:
    • Re: NSCell subclass editing
      • From: tiennou <email@hidden>
References: 
 >NSCell subclass editing (From: tiennou <email@hidden>)

  • Prev by Date: Re: What should be the same object doesn't seem to be
  • Next by Date: Fwd: CoreData model optimization? (slow on insert with fetches)
  • Previous by thread: NSCell subclass editing
  • Next by thread: Re: NSCell subclass editing
  • Index(es):
    • Date
    • Thread