Re: Custom Outline
Re: Custom Outline
- Subject: Re: Custom Outline
- From: Jerry Krinock <email@hidden>
- Date: Fri, 25 Nov 2005 10:46:07 -0800
- Thread-topic: Custom Outline
on 05/11/25 02:02, email@hidden at
email@hidden wrote:
> But when I edit a cell which has text longer than the column, I'd like to
> scroll the text in order to display the end of the text and not the
> beginning.
> Right now, it displays and select the beginning.
> Guillaume
Yes, I think I lost some hair scratching my head over something similar a
few months ago. This might be what you want. It is a "category" method
I've added to NSString which returns an attributed string truncated to a
desired width:
- (NSAttributedString *)asAttributedStringTruncatedToWidth:(float)width
{
NSMutableString* text = [self mutableCopy];
NSAttributedString* s = [NSAttributedString alloc];
NSMutableParagraphStyle *ps = [[NSParagraphStyle defaultParagraphStyle]
mutableCopy];
[ps setLineBreakMode: NSLineBreakByTruncatingHead];
s = [s initWithString: text attributes:[NSDictionary
dictionaryWithObjectsAndKeys:
ps, NSParagraphStyleAttributeName, nil]];
[text release];
[ps release];
return [s autorelease];
}
_______________________________________________
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