Re: NSTextField refreshes are wacky.
Re: NSTextField refreshes are wacky.
- Subject: Re: NSTextField refreshes are wacky.
- From: "Clark S. Cox III" <email@hidden>
- Date: Mon, 11 Mar 2002 16:21:41 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday, March 11, 2002, at 04:00 , Jonathan Feinberg wrote:
I am using an NSTextField as a status bar.
When I
[theField setStringValue:@"Foo"];
the new text gets written *over* whatever text was already there. I
haven't been able to find a mantra that will cause the field to
correctly erase itself before drawing the new string. On top of this,
it happens intermittently; sometimes the update happens correctly.
I have found that resizing the parent window will cause the field to
display
correctly. This led me to try
[textStatus setStringValue:msg]; [textStatus setNeedsDisplay];
[[textStatus window] displayIfNeeded];
which caused the problem to happen less frequently. But it still happens.
Are you doing this in a multi-thread app, from some thread other than
the main thread? If you are, then there is your problem, as the AppKit is
not re-entrant. Instead of setting the new value directly (or doing
anything that will directly affect the UI), you should instead message
dome object to do it in the main thread.
- --
Clark S. Cox, III
email@hidden
http://clarkcox.dyndns.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (Darwin)
Comment: For info see
http://www.gnupg.org
iD8DBQE8jR/rd6STocYT1xURAhWvAJ9EieAobvQ6FltIUB5zFJz5/jlKtgCfYPt4
WfEmlzYgGULTHcNLS/+WJXg=
=tl2s
-----END PGP SIGNATURE-----
_______________________________________________
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.