Re: NSCell setControlSize:NSSmallControlSize doesn't show change
Re: NSCell setControlSize:NSSmallControlSize doesn't show change
- Subject: Re: NSCell setControlSize:NSSmallControlSize doesn't show change
- From: Corbin Dunn <email@hidden>
- Date: Mon, 14 Sep 2009 08:46:19 -0700
Setting the controlSize for an NSTextFieldCell doesn't do anything (as
far as I know). You probably want to make the font size small to
really see a change. Please log a bug requesting -setControlSize to do
this for you automatically. I believe IB sets the font for you when
this is changed there.
corbin
On Sep 13, 2009, at 6:57 PM, BareFeet wrote:
Hi all,
I'm programmatically building an NSTable. I add columns in a loop
and am trying to set various attributes. All of it works except
setControlSize:NSSmallControlSize. When I get the value after
setting (ie using controlSize), it seems to have changed, but the
actual cell/column is still shown in regular size (even after
initiating a view update). What am I missing?
Sample code:
// BFTableViewCategory.h
#import <Cocoa/Cocoa.h>
@interface NSTableView (ExtrasByTom)
- (void) createColumns:(NSArray*)dataColumns;
@end
#import "BFTableViewCategory.h"
@implementation NSTableView (ExtrasByTom)
- (void) createColumns:(NSArray*)dataColumns {
for (NSString* columnName in columnNames) {
NSTableColumn* newTableColumn = [[[NSTableColumn alloc]
initWithIdentifier:columnName] autorelease];
[[newTableColumn headerCell] setStringValue:columnName];
[self addTableColumn:newTableColumn];
[[newTableColumn dataCell] setAlignment:NSRightTextAlignment];
[[newTableColumn dataCell] setControlSize:NSSmallControlSize]; //
only thing that doesn't show change
[newTableColumn setWidth:100];
}
}
Thanks,
Tom
BareFeet
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden