copy formatted text
copy formatted text
- Subject: copy formatted text
- From: Uwe Schlosser <email@hidden>
- Date: Fri, 28 Mar 2003 22:10:35 +0100
I would like to copy formatted text from one NSTextView to another
NSTextView and I use the following code:
#import "controller.h"
@implementation controller
-(IBAction)copy:(id)sender
{
NSTextStorage *attrStr=[[[NSTextStorage alloc]
initWithAttributedString:[myTextView1 textStorage]]autorelease];
[myTextView2 setEditable:YES];
[myTextView2 setString:@""];
if([attrStr length])
[myTextView2 insertText:attrStr];
[myTextView2 setEditable:NO];
}
@end
(In Interface Builder I have selected Multiple fonts allowed)
But this code does not reliable copy formatted text with different font
sizes and font types. I have no problems with justifying or different
font colours.
Thanks for any help
Uwe
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.