Re: NSCell's -setStringValue:
Re: NSCell's -setStringValue:
- Subject: Re: NSCell's -setStringValue:
- From: Daniel Todd Currie <email@hidden>
- Date: Tue, 18 May 2004 10:01:01 -0700
I am trying to resize table columns based on their content's width, as
described here:
http://cocoadev.com/index.pl?SizeTableColumnsAfterWidestEntry
I don't actually wish to alter the data source... I'm just wondering
what NSCell's setStringValue is actually doing if it isn't altering the
data source.
On 2004 May 18, at 01:43, James Chen wrote:
Why don't you implement the data source?
If you have some reason to not do so, state the problem then maybe we
could have some solutions.
If not, implement data is the appropriate way to use table view in my
opinion.
Regards,
James
------------------------------------
Ulead Systems Inc.
James Chen
Software Engineer
Image Div.
------------------------------------
On May 18, 2004, at 2:09 PM, Daniel Todd Currie wrote:
When i use NSCell's -setStringValue:, what is it actually doing?
It's not changing the table's data source, but it is apparently
changing the cell's width, because [cell cellSize].width is changing
as I change the string value.
I played around with this using the following code:
NSCell *cell = [[myTableView
tableColumnWithIdentifier:@"myIdentifier"] dataCell];
[cell setStringValue:@"test"];
NSLog(@"cell width = %f", [cell cellSize].width);
[cell setStringValue:@"fibula"];
NSLog(@"cell width = %f", [cell cellSize].width);
And the log:
2004-05-17 22:53:30.247 myApp[8699] cell width = 27.594000
2004-05-17 22:53:30.249 myApp[8699] cell width = 39.723999
This ends up doing what I want it to do (it tells me what width the
cell should have for the words "test" and "fibula"), but it bothers
me a little that this method doesn't seem to have any effect. I
can't figure out why this works.
Thanks in advance for any insight...
-- Daniel Currie
_______________________________________________
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.
_______________________________________________
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.
_______________________________________________
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.