0

I'm using a custom subclass of NSTextView in my project, and I'd like to know if someone knows a way to display graphics in them in the fashion Mail.app from Apple does when showing text being replied to.

Like this:

text is appended a blue vertical line in front of every line

I read on SO in another message that the component used to display mails might be a WebView. That's fine by me, I could use that. Does that mean then that this line should be drawn using CSS or something like this?

1 Answers1

0

Mail's editor is a WebView. You could do this with an NSTextView but with a LOT of extra layout and drawing work.

Joshua Nozzi
  • 60,946
  • 14
  • 140
  • 135
  • Ok, great thanks, good to know. So the recommended way would be to do this in the html part of the text I want to display? – Olivier Pallière Oct 03 '12 at 14:14
  • The *easiest* way if you don't need fine control over editing particulars is to use a web view. If you need fine control or rendering options not provided by HTML/CSS, you'll need to do it the hard way: text system customization via NSTextView and friends. – Joshua Nozzi Oct 03 '12 at 14:17
  • Just to be clear: a web view can be placed in editable mode and you can hook high-level editing like insert/delete, etc. to customize within reason. If you need things like custom attributes, you're in for a world of hurt using WebView. – Joshua Nozzi Oct 03 '12 at 14:18
  • Yes I saw that already while playing with the editing part of my app. The webview has nice features that allow editing fonts, colors, style, and get the HTML afterwards. Now I need to go learn some css then on how to draw that line on a paragraph, Thanks! – Olivier Pallière Oct 03 '12 at 14:20
  • The CSS you want is border-left: 3px and similar. – Joshua Nozzi Oct 03 '12 at 14:21