我用自己的数据源创建 NSOutlineView。现在的问题是,在扩展项目时,它会向上和向右扩展,而我已经提到了框架。如何解决这个扩展?我想要一个固定的窗口。
NSOutlineView * outlineview; ///< Outline view.
OutlineDataSource * datasource; ///< Data source.
//Create the outline view.
outlineview = [[NSOutlineView alloc] initWithFrame:NSMakeRect (10, 430, 400, 800)];
[outlineview setDelegate:self];
//Create the data source.
datasource = [[OutlineDataSource alloc]init];
//Set the data source.
[outlineview setDataSource:(id<NSOutlineViewDataSource>)datasource];
NSTableColumn *c = [[NSTableColumn alloc] initWithIdentifier: @"Cases"];
//Create a column.
[c setEditable: NO];
[c setMinWidth: 450];
[outlineview addTableColumn: c];
[outlineview setOutlineTableColumn: c];
//Add the outline view to the window.
[view addSubview: outlineview];