• 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
Displaying HTML in an NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Displaying HTML in an NSTextView


  • Subject: Displaying HTML in an NSTextView
  • From: Graham <email@hidden>
  • Date: Fri, 6 May 2005 17:20:20 -0400

Hi,

I have an NSTextView subclass that I wish to use to display HTML. The HTML comes from a String and not a URL.
I cannot work out the correct way to do this.

I think I need to do something like this in my NSTextView subclass:

        NSMutableAttributedString str=new NSMutableAttributedString(new NSData(myHTMLString.getBytes()), new NSMutableDictionary(new NSDictionary(NSAttributedString.NSHTMLTextDocumentType, NSAttributedString.NSDocFormatTextDocumentType)));
        textStorage().setAttributedString(str);

but it doesn't render the html (such as hyperlinks). I know I don't have the mutable string constructor correct.

Any hints in Java or Obj-C would be great.

Thanks

Graham
 _______________________________________________
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

  • Follow-Ups:
    • Re: Displaying HTML in an NSTextView
      • From: Seth Willits <email@hidden>
  • Prev by Date: Re: NSArray usage question.
  • Next by Date: Re: Interface builder question.
  • Previous by thread: Re: registerDefaults Conflict with Bindings?
  • Next by thread: Re: Displaying HTML in an NSTextView
  • Index(es):
    • Date
    • Thread