• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextView and Line Numbering
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSTextView and Line Numbering
      • From: James Derry <email@hidden>
References: 
 >Re: NSTextView and Line Numbering (From: James Derry <email@hidden>)

  • Prev by Date: Re: New to Cocoa
  • Next by Date: Re: How to get image real number of bits per pixel
  • Previous by thread: Re: NSTextView and Line Numbering
  • Next by thread: Re: NSTextView and Line Numbering
  • Index(es):
    • Date
    • Thread