Question

J'ai un NSTableView avec 4 colonnes. Je souhaite modifier les propriétés de redimensionnement automatique de la première NSTableColumn. Si l'utilisateur redimensionne l'application, seule la première colonne peut changer sa largeur. Mon 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];

Comme vous pouvez le voir, les colonnes sont ajoutées par programme.

Merci!

Était-ce utile?

La solution

ajouté cette ligne et cela a fonctionné:

[TableView setColumnAutoresizingStyle:NSTableViewFirstColumnOnlyAutoresizingStyle];
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top