NSString's -(NSSize)sizeWithAttributes returns zero!?
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