creating NSTextField instances
creating NSTextField instances
- Subject: creating NSTextField instances
- From: Aaron Fothergill <email@hidden>
- Date: Wed, 20 Oct 2004 01:25:14 +0100
I'd like to be able to create and display an NSTextField programatically (rather than linking to a pre-made one from IB). I've had a go at making one appear in the drawRect of the view I want it to appear in by doing...
tempTextField = [[[NSTextField alloc] initWithFrame:tr] retain];
[tempTextField setEditable:YES];
[tempTextField setSelectable:YES];
[tempTextField setStringValue:[tempObject objectName]];
[tempTextField setBackgroundColor:[NSColor whiteColor]];
[tempTextField setDrawsBackground:YES];
[tempTextField setBordered:YES];
[tempTextField setNeedsDisplay:YES];
but nothing displays. kind of indicating I'm doing something wrong.
I haven't been able to find any examples where someone's programatically creating a text field. They all seem to use the Interface Builder route. Does anyone know if it's possible and if so, what am I doing wrong ?
Aaron
_____________________________
Aaron Fothergill : MD / Lead Coder
Strange Flavour Ltd
email@hidden
http://www.strangeflavour.com _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden