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: Mike Ferris <email@hidden>
- Date: Sat, 7 Dec 2002 09:54:17 -0800
What I would try first is using a custom attachment. You can make an
NSTextAttachmentCell subclass that will draw the line. To get the "all
the way across" behavior you would probably want to override these
NSTextAttachmentCell methods:
- (NSRect)cellFrameForTextContainer:(NSTextContainer *)textContainer
proposedLineFragment:(NSRect)lineFrag glyphPosition:(NSPoint)position
characterIndex:(unsigned)charIndex;
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
characterIndex:(unsigned)charIndex layoutManager:(NSLayoutManager
*)layoutManager;
The first would return a rect that had the right width given the width
of the textContainer (or its view). The second would simply draw the
line.
Mike Ferris
_______________________________________________
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.