NSScrollView bug : can someone confirm ?

  • Hi !

    I'm facing a very strange behavior with an NSScrollView instance (not
    subclassed).

    I've created a scroll view programatically which contains a
    NSImageView instance. Here is the code I use for this purpose :

    - (void)awakeFromNib
    {
    NSWindow * theWindow = [self window];

    NSImageView * theImageView = [[NSImageView alloc]
    initWithFrame:NSMakeRect(0,0,300,300)];

    [theImageView setImageFrameStyle:NSImageFrameGrayBezel];

    NSScrollView * scrollView = [[NSScrollView alloc] initWithFrame:
    [[theWindow contentView] frame]];

    [scrollView setHasVerticalScroller:YES];
    [scrollView setHasHorizontalScroller:NO];
    [scrollView setAutohidesScrollers:YES];
    [scrollView setBorderType:NSNoBorder];
    [scrollView setAutoresizingMask:NSViewWidthSizable|
    NSViewHeightSizable];

    [scrollView setDocumentView:theImageView];

    [theImageView release];

    [theWindow setContentView:scrollView];

    [scrollView release];
    }

    Everything seems to work perfectly...until I stretch the window
    vertically to an height smaller than the height of the image view :
    the vertical scroller should appear but it doesn't until the height
    of the window is around 20 pixels smaller than the height of the
    image view (I guess this ~20 pixels is the exact height of the
    horizontal scroller that is not displayed).

    I've created a test project which highlight the problem. It can be
    downloaded here : http://homepage.mac.com/eric.morand/.Public/Test.zip

    Just build it, run it and gently resize the window vertically until
    the vertical scroller appears.

    Can anyone help me on this ? Am I doing something wrong or is this a
    (known) bug ?

    Thanks,

    Eric.
previous month october 2006 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 31          
Go to today