Re: NSTextView tab stop count
Re: NSTextView tab stop count
- Subject: Re: NSTextView tab stop count
- From: Shane Stanley <email@hidden>
- Date: Sat, 15 Oct 2016 10:22:08 +1100
On 15 Oct. 2016, at 12:43 am, tridiak <email@hidden> wrote:
>
> This works up to 12. Above that, it sticks to 12.
Are you sure you're just not seeing them because the text in some columns is longer than you tab width?
I just made a simple example with this:
NSMutableAttributedString *mas = [[NSMutableAttributedString alloc] initWithString:@"\t1\t2\t3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t16\t17\t18\t19\t20\t21\t22\t23\t24\t25\t26\t27\t28\t29\t30"];
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
NSMutableArray* ma=[NSMutableArray array];
for (int t=0; t< 31; t++) {
[ma addObject:[[NSTextTab alloc] initWithType:NSLeftTabStopType location:t*28.0f]];
}
[style setTabStops:ma];
[mas addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0,mas.length)];
[self.textView insertText:mas];
It works as expected.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden