• 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
NSImageCell cellSize
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSImageCell cellSize
      • From: Calum Robinson <email@hidden>
  • Prev by Date: Beginner question with sheets
  • Next by Date: Re: NSImageCell cellSize
  • Previous by thread: Re: Beginner question with sheets
  • Next by thread: Re: NSImageCell cellSize
  • Index(es):
    • Date
    • Thread