Refreshing the column title of an NSTableView
Refreshing the column title of an NSTableView
- Subject: Refreshing the column title of an NSTableView
- From: Raphaël Delcroix <email@hidden>
- Date: Tue, 30 Jul 2002 15:50:12 +0200
Hi,
This problem doesn't seem to appear in the Mailing List, so I suppose
the real problem is in my code...
I have an NSTableView object, and I want to modify the header titles
(using the value of an NSTextField). It works, but not on the screen
(nothing changes). The user needs to click on the title, to see that it
has been modified.
Do I update the right object (myTableView) ?
// this is a notification called when the 'typeTextField' is modified
('type' is the identifier of my column) :
- (void) typeNameChanged:(NSNotification *)n {
NSTableColumn *column = [myTableView
tableColumnWithIdentifier:@"type"];
NSMutableString *title = [[NSMutableString alloc] init];
// I set a string for the future title :
[title setString:[typeTextField stringValue]];
[title appendString:@" for :"];
// I set the title :
[[column headerCell] setStringValue:title];
[title release];
// and this doesn't seem to do anything :
[myTableView setNeedsDisplay:YES];
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.