NSTextView/NSScrollView update problems

  • Hi

    I'm trying to manually recreate the default automatic behaviour of NSTextView (wrapping text, infinite page length, etc).  The problem I'm having is when, as the text view fills up with text, the text extends past the bottom of the view and it becomes time for the encompassing NSScrollView to update the scroll position.  It succeeds to a point and then stops.  I can correct the NSScrollView's view of things by resizing the window to make the text visible and then shrinking the window again.

    The various settings I have are as follows:

    NSSize containerSize = NSMakeSize(0, 1000000000);
    textContainer = [[NSTextContainer alloc] initWithContainerSize:containerSize];
    [textContainer setWidthTracksTextView:YES];
    ...
    [scrollView setHasVerticalScroller:YES];
    [scrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
    ...
    [textView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
    [textView setVerticallyResizable:YES];

    I've also tried setting the 'textView' autoresizing mask to just NSViewWidthSizable but it doesn't fix the problem.  Any help that can be offered would be greatly appreciated.

    Regards,

    David Schweinsberg
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today