Re: Suppressing drawing
Re: Suppressing drawing
- Subject: Re: Suppressing drawing
- From: Gordon Apple <email@hidden>
- Date: Sun, 16 Dec 2007 15:34:03 -0600
I have a similar problem, but at the window level. The following two
lines of code cause the window to first redraw in the wrong position, then
immediately in the correct position, resulting in a visible flash jump. I
would also like to suppress the window drawing until both statements
execute.
// Set the window size and readjust location so title bar stays put
[window setContentSize:NSMakeSize([contentView frame].size.width,
totalHeight)];
[window setFrameTopLeftPoint:frameTopLeftPoint];
This is in a controller that handles disclosure panes within an
inspector panel window.
> 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