Re: NSTextField refreshes are wacky.
Re: NSTextField refreshes are wacky.
- Subject: Re: NSTextField refreshes are wacky.
- From: Jonathan Feinberg <email@hidden>
- Date: Tue, 12 Mar 2002 22:09:40 -0500
This isn't doing what you think it's doing. NSNotificationCenter
will not cross threads for you. (That is, the method which posts
the notification and the method which receives the notification
always run in the same thread.)
That explains why it didn't fix the problem in every case. D'oh.
- (void)setStatus:(NSString *)msg
{
[textStatus setStringValue:msg];
[textStatus setNeedsDisplay];
[[textStatus window] displayIfNeeded];
}
Normally you should not need to call -[NSView setNeedsDisplay:] or
-[NSWindow displayIfNeeded] after changing a text field's value (or
just about any value of a control). If you need to do this to get
things to work, it is a pretty good sign that you are, most likely,
doing something wrong.
Yes; the second and third lines of code had actually already been
removed from my code; those were vestiges of earlier attempts to fix
the wrong problem.
To sum up: You need to use a different method to run your code in
the main thread. I think some suggestions on how to do this were
posted earlier, but let me know if you can't figure it out.
I may have missed that, unless you're referring to one fellow's
suggestion to look into Distributed Objects. I'll go and absorb
those docs now.
I will write back with a success story or death, soon.
--
Jonathan Feinberg email@hidden Inwood, NY, NY
http://MrFeinberg.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.