Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-setNeedsDisplay/-display don't work with NSTableView column titles !



Hello,

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];
}

Thanks for all help !
_______________________________________________
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.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.