Re: width of NSString in pixels
Re: width of NSString in pixels
- Subject: Re: width of NSString in pixels
- From: Eric Peyton <email@hidden>
- Date: Tue, 27 Nov 2001 09:15:08 -0600
No, that will only return the length of the string in characters ...
What you want is in NSStringDrawing.h in AppKit
@interface NSString(NSStringDrawing)
- (NSSize)sizeWithAttributes:(NSDictionary *)attrs;
@end
From the correct attributes you should be able to determine how big
(high and wide) the string is.
Eric
On Tuesday, November 27, 2001, at 08:39 AM, John Nestor wrote:
[string length] I believe
On Tuesday, November 27, 2001, at 07:27 AM, Robert Miller wrote:
Hello,
Can someone tell me how to determine the width of an NSString in
pixels using Cocoa? I can only find this functionality in the Carbon
API
using the Appearance Mgr. ? Am I missing something ?
Thanks in advance,
Regards,
Bob M.
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev