Re: nstableview **very** basic question

2009-03-23 Thread Michael


On Mar 21, 2009, at 9:24 PM, Jerry Krinock wrote:



On 2009 Mar 21, at 14:27, Michael wrote:


I cannot get tableview to show columns of constant width.



[tv sizeToFit];


What I get when I use the above code is the first couple of columns  
varying in size, then the next n columns equally space.


If I have missed something in the documentation,


Maybe you have.  The documentation for -[NSTableView sizeToFit] says:
 All columns are resized to the same size, up to a column's maximum  
size.



Yes...I did see that, but I read it slightly differently. I read it to  
mean that the receiver's columns will be set equal to one another up  
to the max size. I assumed that tableview would know the max width of  
the view and calculate the widths accordingly. What I was getting was  
unequal widths.




H.  What are your columns' maximum sizes?  These can be set in  
Interface Builder, but to find out for sure, try something like this:


There were some **very** weird max widths!!  :-) which may have played  
a role here..widths with integers in the 20 to 30 figures long!!

Eg (340282306073709652508363335590014353408.00)

I got it to work as I expected it by doing what you suggested...I  
think. ie setting each column to the same max width...


Thank you ...appreciated.




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


nstableview **very** basic question

2009-03-21 Thread Michael
I've been struggling with this for a few days...so time to ask, if I  
may.
I am trying to emulate Scott Anguish's multiplication table in his  
book. I cannot get tableview to show columns of constant width.


I have looked at the guides of Apple, tried to understand all the  
nuances of tableview, scrollview, headers etc, looked at numerous  
tutorials on NSTableview, (most a little dated),  discerned  that  
perhaps I should be looking at NSTableColumn, and thought I had found  
the answer doing this.


-(void) awakeFromNib
{
NSLog(@awakeFromNib: setting \sizeToFit\);
[tv sizeToFit];

}

where tv is declared as:  IBOutlet NSTableView *tv;

As far as I can tell, the outlet is set correctly, NSLog is called at  
the appropriate time.


What I get when I use the above code is the first couple of columns  
varying in size, then the next n columns equally space.


If I have missed something in the documentation, I would appreciate a  
pointer, but somehow, I cannot believe that it is this difficult to  
do, but perhaps I am doing something that will become a lot easier  
further into Hillegas tutorial?


Thanks in advance.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: nstableview **very** basic question

2009-03-21 Thread Jerry Krinock


On 2009 Mar 21, at 14:27, Michael wrote:


I cannot get tableview to show columns of constant width.



[tv sizeToFit];


What I get when I use the above code is the first couple of columns  
varying in size, then the next n columns equally space.


If I have missed something in the documentation,


Maybe you have.  The documentation for -[NSTableView sizeToFit] says:
   All columns are resized to the same size, up to a column's  
maximum size.


H.  What are your columns' maximum sizes?  These can be set in  
Interface Builder, but to find out for sure, try something like this:


for (NSTableColumn* tc in [tv tableColumns]) {
   NSLog(@maxWidth = %f, [tc maxWidth]) ;
}


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com