Re: How to draw a horizontal line in a NSTextView?
Re: How to draw a horizontal line in a NSTextView?
- Subject: Re: How to draw a horizontal line in a NSTextView?
- From: Arthur Clemens <email@hidden>
- Date: Tue, 10 Dec 2002 15:03:48 +0100
On zaterdag, dec 7, 2002, at 05:37 Europe/Amsterdam, Dietrich Epp wrote:
>
On Friday, December 6, 2002, at 04:13 , Arthur Clemens wrote:
>
>
> It's probably simple, but I cannot find a way how to draw a
>
> horizontal line in a NSTextView.
>
> What I have in mind is something similar to a <hr> tag in HTML: it
>
> gets wider as the text view is scaled.
>
> I could use a NSBezierPath, but how to manage that it scrolls
>
> together with the text?
>
>
Read the big spiel about it on Apple's website. It is not trivial.
>
>
http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/
>
ProgrammingTopics/
>
Misc/TextHandlingPage.html
Still, if I use a NSTextView as browser (I was trying out sample code
from CocoaBB:
http://jrepp.com/cocoabb/viewtopic.php?t=32 ), <hr> tags
are rendered normally.
So it seems there is an easier way.
When I print out the NSMutableAttributedString that stores the HTML data
[[NSMutableAttributedString alloc] initWithHTML:[[myURL
URLHandleUsingCache:YES] resourceData] baseURL:myURL
documentAttributes:nil];
I get this with an HTML document with only a <hr> in the body:
\\ufffc{
"HTML_Tree_Retain" = <HTMLDocument: 0xacbfe0>;
NSAttachment = Name "<No name>";
}
{
"HTML_Tree_Retain" = <HTMLDocument: 0xacbfe0>;
NSFont = "CGS Times-Roman 12.00 pt. P [] (0x00b3a760)
fobj=0x00b35930, spc=3.00";
}
How can I pull out this and use it in another application? And what is
in this NSAttachment?
Arthur Clemens
_______________________________________________
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.