Re: Suppressing drawing
Re: Suppressing drawing
- Subject: Re: Suppressing drawing
- From: John Stiles <email@hidden>
- Date: Sat, 15 Dec 2007 21:27:46 -0800
All windows in OS X are double-buffered; as such, the redraw is
suppressed until the event loop next runs.
In other words, your flicker is caused by something else...
On Dec 15, 2007, at 5:47 PM, Mike Kobb wrote:
Hello,
I'm fairly new to Cocoa programming, and I'm having a little
drawing problem that I'm sure is simple to solve if somebody would
be kind enough to point me in the right direction.
Here's my problem. I have an NSTextView with some text in it.
When a particular event happens, I need to change the text in the
view, and also resize the view (I'm moving the left edge of the
view over a bit to make room for a "caution" icon that only appears
when the app encounters a problem.
So, the first thing that I do is to set the frame and bounds of the
view (setView and setBounds), and then I call
replaceCharactersInRange:withAttributedString: to replace the
text. I do these two things one right after the other in one
function. Sometimes, I get a brief flicker as the view re-draws in
its new size, before the new text renders.
What I'd like to do is to suppress the re-draw of the view until
both the resize and the text set have completed.
I'd appreciate any pointers to the proper way to do this. I've
tried searching both the docs and the list, but I must be looking
for the wrong terminology.
Thanks!
--Mike
_______________________________________________
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:
40blizzard.com
This email sent to email@hidden
_______________________________________________
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