Re: NSTextView and Line Numbering
Re: NSTextView and Line Numbering
- Subject: Re: NSTextView and Line Numbering
- From: Koen van der Drift <email@hidden>
- Date: Tue, 25 Feb 2003 20:04:46 -0500
At 1:36 PM -0500 2/23/03, James Derry wrote:
>
So, as long I DON'T mess with the original wrapping/sizing behavior of the
>
NSTextView, your routines worked perfectly for me. Using the setWordWrapping
>
I implemented above causes your routines to behave strangely for me.
>
Hi James,
Just for comparison, here's how I set up my textview:
-(id)initWithFrame:(NSRect)frame
{
if (self = [super initWithFrame:frame])
{
NSSize contentSize;
IDViewContainer *myContainer;
contentSize = [[self enclosingScrollView] contentSize];
frame = NSMakeRect(0, 0, contentSize.width, contentSize.height);
myContainer = [[IDViewContainer allocWithZone:[self zone]]
initWithContainerSize:NSMakeSize(frame.size.width, 100000)];
[myContainer setWidthTracksTextView:YES];
[myContainer setHeightTracksTextView:NO];
[self replaceTextContainer:myContainer];
[myContainer release];
[self setMinSize:frame.size];
[self setMaxSize:NSMakeSize(100000, 100000)];
[self setHorizontallyResizable:NO];
[self setVerticallyResizable:YES];
[self setAutoresizingMask:NSViewWidthSizable];
[self setAllowsUndo:YES];
[self setFont:[NSFont fontWithName: @"Courier" size: 14]];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(windowDidUpdate:)
name:NSWindowDidUpdateNotification object:[self
window]];
}
return self;
}
So there are some differences with your setup that could explain the
behaviour you're seeing.
- 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.