Simple NSView Question
Simple NSView Question
- Subject: Simple NSView Question
- From: Justin Giboney <email@hidden>
- Date: Wed, 20 Aug 2008 10:12:07 -0600
I think that I am really close to this... but I can't find the next
step.
I am trying to build a view programatically after the application has
launched. So I have a custom view that has one method:
- (void)addLabelWithText:(NSString *)text
{
NSTextField *newTextField = [[NSTextField alloc]
initWithFrame:NSMakeRect(5,5,17,50)];
[newTextField setStringValue:text];
[self addSubview: newTextField];
//[self setNeedsDisplay:YES];
}
If I add the code above into the drawRect: method, it works just fine.
I think I need the commented line, but whether it is commented or not,
it doesn't work. What do I have to do to redraw the view with the text
field?
Thank you,
Justin Giboney
_______________________________________________
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