• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
copy formatted text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: copy formatted text
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Cut copy and paste custom object
  • Next by Date: Re: firstResponder help
  • Previous by thread: Cut copy and paste custom object
  • Next by thread: Re: copy formatted text
  • Index(es):
    • Date
    • Thread