NSImageCell cellSize
NSImageCell cellSize
- Subject: NSImageCell cellSize
- From: Calum Robinson <email@hidden>
- Date: Tue, 18 Mar 2003 14:16:20 +0000
NSCell *newCell = [[NSImageCell alloc] init];
[newCell calcDrawInfo:rect];
[newCell setObjectValue:[NSImage imageNamed:@"NSApplicationIcon"]];
NSLog(@"cell size = %@", NSStringFromSize([newCell cellSize]));
(rect is {{1, 1}, {600, 152}} i.e. big enough for 128x128)
[newCell cellSize] is always {0,0} - why? When you set the object value
of the NSImageCell why does it not return "the minimum size needed to
display the receiver, taking account of the size of the image..." to
quote the docs? Using -setImage: yieldds exactly the same results.
I'm trying to write code that can handle any type of cell, so I can't
just call [[newCell image] size], as that won't work for custom NSCells
or text field cells.
Calum Robinson
http://homepage.mac.com/calumr
_______________________________________________
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.