Re: NSCell and IB
Re: NSCell and IB
- Subject: Re: NSCell and IB
- From: Carlos Weber <email@hidden>
- Date: Tue, 18 Sep 2001 08:11:29 -1000
On Monday, September 17, 2001, at 03:05 , Enrique Zamudio wrote:
<...>
Regarding the image cell: perhaps you can just use a NSImageCell but
maybe you'll want to use something else, that's up to you. you have to
set it programatically, I think there's a setDataCell: method to let you
replace the data cell that's used in a NSTableColumn. You can also
replace the header cells if you need to.
<...>
Don't forget that the "image" in an NSImageCell can actually draw
anything you want via the NSCustomImageRep mechanism. You could subclass
NSImage and write just 2 methods: first, a drawing proc for your custom
imagerep ( - (BOOL)drawCustomRep: (id)theImageRep ) in which you just
draw your text and images as you want them; and second, an override of
-initWithSize:, in which you would create a NSCustomImageRep via
-initWithDrawSelector: @selector( <the drawing proc you just defined>)
delegate: self. Then add the customImageRep to your image as its only
imagerep. This would be the image you would assign to the NSImageCell
( -setObjectValue:), which would in turn be assigned as the dataCell of
the table view.