Setting NSTextField inside drawRect:
Setting NSTextField inside drawRect:
- Subject: Setting NSTextField inside drawRect:
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Sat, 16 Feb 2008 15:01:32 +0700
I have in 10.4.11 an NSWindow with a MyView and an NSTextField.
- (void)drawRect:(NSRect)rect
{
[ [ NSColor redColor ] set ];
NSRectFill( rect );
[ textField setStringValue: @"Buh" ];
// without the following line, the textField will never show its new
text:
[ self performSelector: @selector(textFieldUpdate) withObject: nil
afterDelay: 0.0 ];
}
- (void)textFieldUpdate { [ textField setNeedsDisplay: YES ]; }
Why does setting an NSTextField form inside drawRect: not work?
Is this fact documented somewhere?
Kind regards,
Gerriet.
_______________________________________________
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