• 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
NSString's -(NSSize)sizeWithAttributes returns zero!?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString's -(NSSize)sizeWithAttributes returns zero!?


  • Subject: NSString's -(NSSize)sizeWithAttributes returns zero!?
  • From: Tomas Zahradnicky <email@hidden>
  • Date: Mon, 7 Feb 2005 12:12:13 +0100

Hi,

I'm trying to get the length of unmangled symbol whose length is 3214 characters. I've put this C++ symbol into a NSString and I'd like to get the pixel size of this symbol. I'd like to enlarge table's column to fit the widest symbol for scroller to become active.

The problem is that sizeWithAttributes method returns 0. Is that a bug or I do something wrong? I could split the NSString into several substrings and take the sum, but that is clumsy, isn't it?


NSDictionary* attr = [NSDictionary dictionaryWithObjectsAndKeys:
[NSFont controlContentFontOfSize:0.0], NSFontAttributeName,
nil];


  NSSize         siz = [mWidestSymbolName sizeWithAttributes:attr];

[[mView tableColumnWithIdentifier:@"name"] setWidth: siz.width];



Am I doing something wrong?


Thanks,

  Tomas
--
# Ing. Tomas Zahradnicky, Jr.
# The Czech Technical University
# Dept of Computer Science, FEE-CTU Prague
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Overriding NSApplication in Cocoa-Java
  • Next by Date: NSImageView printing
  • Previous by thread: Re: Overriding NSApplication in Cocoa-Java
  • Next by thread: NSImageView printing
  • Index(es):
    • Date
    • Thread