Re: NSTextField refreshes are wacky.
Re: NSTextField refreshes are wacky.
- Subject: Re: NSTextField refreshes are wacky.
- From: email@hidden
- Date: Tue, 12 Mar 2002 00:03:04 -0800
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.
Any clues?
You don't say so, but it sounds to me like you have somehow changed
the background of the textfield to not draw, or to draw in a color that
is transparent. In this case, you need to make sure that -isOpaque is
returning NO for your now non-opaque textfield. You need to subclass
NSTextField and make it return NO for -isOpaque by simply overriding
that method.
If it is already returning NO for isOpaque, then I'm a little bit
stumped, and you'll need to post more details about what you're doing.
Normal textfields have no issues in this area, so you must be doing
*something* funny...
Ben Haller
Stick Software
_______________________________________________
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.