On 19 Dec 2008, at 10:50 am, Corbin Dunn wrote:


On Dec 18, 2008, at 3:28 PM, Graham Cox wrote:

The five kinds of representedObject are a) a custom class of my own, b) a NSColor, c) a NSString, d) a NSValue and d) an NSImage. Corresponding to these I set the dataCell to a,d) NSImageCell, b) a custom cell type to handle colours, c,d) a NSTextFieldCell.

A regular NSTextFieldCell, or a custom subclass? If so, what code is in in it?

corbin


Actually I'm using RSVerticallyCenteredTextFieldCell from Daniel Jalkut. But I've tried substituting an ordinary NSTextFieldCell and I get the same outcome. Just to show, the code where I make the cell is:

- (NSCell*)     dataCellForType:(int) aType
{
        NSCell* aCell = nil;
        
        switch( aType )
        {
                default:
                        break;
                        
                case kBinOutputTypeStyle:
                case kBinOutputTypeImage:
                        aCell = [[NSImageCell alloc] init];
                        break;
                        
                case kBinOutputTypeColour:
                        aCell = [[GCColourCell alloc] init];
                        break;
                        
                case kBinOutputTypeText:
                case kBinOutputTypeValue:
                        aCell = [[NSTextFieldCell alloc] init];
                        //aCell = [[RSVerticallyCenteredTextFieldCell alloc] 
init];
                        // TODO: for value cell, attach suitable formatter
                        break;
        }
        
        return [aCell autorelease];
}


--Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to