I have a custom NSTextFieldCell
that i want to set on a NSTextField
.
If i set it on the IB it works fine.
And this gets it working like this:
But i want to set it programmatically and i try something like this:
-(void)awakeFromNib{
NSRect theRect = NSRectFromCGRect( NSMakeRect(50, 100, 100, 100));
NSTextField *inputField = [[NSTextField alloc] initWithFrame:theRect];
DRKHUDTextFieldCell *theC = [[DRKHUDTextFieldCell alloc] initTextCell:@"textfield"];
[inputField setCell:theC];
[[_window contentView] addSubview:inputField];
}
This is the result i get:
What is going wrong? Is my code bad or what?