Note that there are some explanatory texts on larger screens.

plurals
  1. PONSOutlineView: Cells are initially too narrow
    text
    copied!<p>I did a little demo to isolate a problem I faced in a Project.</p> <p>When I start the Application, the Cells of the <code>NSOutlineView</code> are too narrow for the text:</p> <p><img src="https://i.stack.imgur.com/TsGPs.png" alt="Initial View"></p> <p>Then I resize the window with the mouse, making it even narrower than the contents of the <code>NSOutlineView</code>:</p> <p><img src="https://i.stack.imgur.com/pteff.png" alt="Narrowed View"></p> <p>When I now enlarge the window again, the problem is cured. From now on the outline works as expected:</p> <p><img src="https://i.stack.imgur.com/4QU0f.png" alt="Re-Enlarged View"></p> <p>This is the main method of my AppDelegate:</p> <pre><code>- (void)applicationDidFinishLaunching:(NSNotification *)notification { NSRect frame = NSMakeRect(0., 0., 400., 300.); NSUInteger styleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask; _mainWindow = [[NSWindow alloc] initWithContentRect:frame styleMask:styleMask backing:NSBackingStoreBuffered defer:NO]; _mainWindow.title = @"Outline"; NSScrollView *leftScrollView = [[NSScrollView alloc] init]; leftScrollView.hasVerticalScroller = YES; leftScrollView.hasHorizontalScroller = NO; leftScrollView.drawsBackground = NO; leftScrollView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; _mainWindow.contentView = leftScrollView; NSOutlineView *outlineView = [[NSOutlineView alloc] init]; NSTableColumn *outlineColumn = [[NSTableColumn alloc] initWithIdentifier:@"Menu Item"]; [outlineView addTableColumn:outlineColumn]; outlineView.outlineTableColumn = outlineColumn; outlineView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleSourceList; outlineView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; outlineView.headerView = nil; _outlineDataSourceAndDelegate = [[MROutlineDataSourceAndDelegate alloc] init]; outlineView.dataSource = _outlineDataSourceAndDelegate; outlineView.delegate = _outlineDataSourceAndDelegate; leftScrollView.documentView = outlineView; [_mainWindow makeKeyAndOrderFront:NSApp]; } </code></pre> <p>Can anyone please explain that odd behavior?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload