2

I have an NSTableView with 4 columns. I want to change the auto resizing properties of the first NSTableColumn. If the user resizes the app, only the first column is allowed to change his width. My code :

// First 3 columns similar to the 4th one.
NSTableColumn*  Column4     = [[[NSTableColumn alloc] initWithIdentifier:@"Column4"] autorelease];
[[Column4 headerCell] setStringValue:@"-"];
[Column4 setWidth:15];
[tableView addTableColumn:Column4];
[tableView setDataSource:self];

As you can see, the columns are added programmatically.

Thanks!

skaffman
  • 398,947
  • 96
  • 818
  • 769
Bruno
  • 87
  • 1
  • 9

1 Answers1

4

Added this line and it worked :

[TableView setColumnAutoresizingStyle:NSTableViewFirstColumnOnlyAutoresizingStyle];
Bruno
  • 87
  • 1
  • 9