I am attempting to programmatically setup the tabs for a simple NSTextView
view. I need to have the entire NSTextView use the same tab stops. I set
the tabs with the following code:
void Write_Tabs(NSArray* tabs, NSTextView* text_view)
{
NSMutableParagraphStyle *paragraph_style =
[Paragraph_Style_In_TextView(text_view,0) mutableCopy];
NSTextStorage *text_storage = [text_view textStorage];
NSRange range = NSMakeRange(0,[text_storage length]);
[paragraph_style setTabStops:tabs];
[text_storage addAttribute:NSParagraphStyleAttributeName
value:paragraph_style range:range];
[text_view setDefaultParagraphStyle:paragraph_style];
}
When I set the tabs, the NSTextView view immediately updates its use of the
tabs. However, the ruler for the NSTextView will not update its tab stops till
I click in the NSTextView view. I tried forcing a redraw of the NSRulerView
without any success.
Is there any method to force the NSRulerView to update it tab stops display or
is there a better method to setup the
tabs?_______________________________________________
Cocoa-dev mailing list ([email protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]