Re: Advanced text-layout questions
Re: Advanced text-layout questions
- Subject: Re: Advanced text-layout questions
- From: Douglas Davidson <email@hidden>
- Date: Mon, 5 Jan 2004 10:30:07 -0800
On Jan 4, 2004, at 3:38 PM, Prachi Gauriar wrote:
If I understand you correctly, I'll be displaying the actual content.
It will be something along the lines of Create, where there is no
XHTML/CSS as far as the user is concerned. The user just creates what
(s)he wants to see, and the app generates XHTML/CSS based off of that.
I was thinking of making a custom view (let's call it PGCanvas) with
an NSTextView (subclass?) embedded within it representing the body
text. You could then insert divs, images, tables, and lists in that
as custom views embedded in text attachments. If the user chose to
remove a div from from the normal flow by using absolute positioning,
I would remove the attachment from the text and add a new child
PGCanvas to the document's PGCanvas which represents the new div.
That could then be positioned arbitrarily on the canvas, just like an
object in OmniGraffle or Create.
Bear in mind that NSTextView is designed to display rich text, not
HTML. The approach you describe should work up to a point, but you're
not likely to be able to get it to a point where it presents arbitrary
HTML in agreement with your browser of choice. You can also create
attributed strings from HTML using the AppKit import methods, but again
this is not going to give perfect fidelity. You need a WebView for
really faithful display of arbitrary HTML, but they are not editable,
and don't give you any control over the details of the displayed
elements. I'm sorry I don't have any really good answers at present;
it is a hard problem.
Douglas Davidson
_______________________________________________
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.