Re: NSTextView and Line Numbering
Re: NSTextView and Line Numbering
- Subject: Re: NSTextView and Line Numbering
- From: Koen van der Drift <email@hidden>
- Date: Sun, 23 Feb 2003 12:54:49 -0500
At 10:25 AM -0500 2/23/03, James Derry wrote:
>
I am having a little bit of difficulty with the pasting text into the
>
TextView with the line numbers displayed. Do you get strange behavior?
No - I have no problems. One thing I added later is a force redraw of the
linenumbers when a sheet comes up. I used the windowDidUpdate notification
for this.
If I
>
step through lineFragmentRectForProposedRect:, it always properly returns
>
the correct corrected rectangle, but I get two types of misbehavior: (1) if
>
I paste in multiple lines, all of the text appears shifted to the left UNDER
>
the "left margin" area. If I paste in a single line, it appears okay, but
>
further lines have the insertion point shifted to the right by the "left
>
margin" distance -- but when typed is inserted into the correct spot.
Are you sure that you added myViewContainer to myTextView? In
myWindowController awakeFromNib I call:
contentSize = [scrollView contentSize];
frame = NSMakeRect(0, 0, contentSize.width, contentSize.height);
myContainer = [[MyViewContainer allocWithZone:[self zone]]
initWithContainerSize:NSMakeSize(frame.size.width, 100000)];
[myContainer setWidthTracksTextView:YES];
[myContainer setHeightTracksTextView:NO];
myTextView = [[MyTextView alloc] initWithFrame:frame];
[myTextView replaceTextContainer:myContainer];
[myContainer release];
hth,
- Koen.
_______________________________________________
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.