Re: Figuring out what's causing redrawing
Just a simple question. Do you have overlapping views going on? If you are overlapping a sibling that is being told to redraw, you will get redraw every time the sibling redraws.. Scott On May 13, 2010, at 12:52 PM, Nick Zitzmann wrote: I've tried searching around but haven't found an answer to this. I have several views that are being constantly apparently needlessly redrawn and I can't figure out why this is happening. How do I catch the culprit that is causing the views to be redrawn? The redrawing is appearing in the usual place, within a call to -[NSWindow displayIfNeeded] in the run loop. I already tried the following: 1. Breaking on -[NSView setNeedsDisplayInRect:], but -drawRect: kept being called anyway, so whatever is causing this is circumventing this method. 2. Observing the value of -[NSView needsDisplay], but the value never changes, and it keeps getting redisplayed anyway. Apparently the value is a perpetual YES... Nick Zitzmann http://www.chronosnet.com/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com This email sent to scottand...@roadrunner.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Figuring out what's causing redrawing
On 13.05.2010, at 21:52, Nick Zitzmann wrote: I've tried searching around but haven't found an answer to this. I have several views that are being constantly apparently needlessly redrawn and I can't figure out why this is happening. How do I catch the culprit that is causing the views to be redrawn? The redrawing is appearing in the usual place, within a call to -[NSWindow displayIfNeeded] in the run loop. I already tried the following: 1. Breaking on -[NSView setNeedsDisplayInRect:], but -drawRect: kept being called anyway, so whatever is causing this is circumventing this method. 2. Observing the value of -[NSView needsDisplay], but the value never changes, and it keeps getting redisplayed anyway. Apparently the value is a perpetual YES... What about a view on top of/behind those views? It's not uncommon that e.g. a pulsing default button causes the view it is embedded on to commonly redraw (though that would generally cause a redraw on another thread, so is probably not your current case). Have you tried examining (or even framing) the dirty rects? Maybe that will show you what other object could be causing this redraw? Cheers, -- Uli Kusterer The Witnesses of TeachText are everywhere... http://groups.yahoo.com/group/mac-gui-dev/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Figuring out what's causing redrawing
On May 15, 2010, at 3:00 AM, Uli Kusterer wrote: What about a view on top of/behind those views? It's not uncommon that e.g. a pulsing default button causes the view it is embedded on to commonly redraw (though that would generally cause a redraw on another thread, so is probably not your current case). Right, but how do I catch what is causing the views on top to redisplay? I already tried breaking on the usual suspects and caught one view that was doing unnecessary redisplays, but even after fixing that I'm still getting a view in a completely different place that is constantly getting redrawn for no apparent reason. Nick Zitzmann http://www.chronosnet.com/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Figuring out what's causing redrawing
Hi I did have one time something similar with an app where lots of views where recalculated when resizing the window. Using Quarts debug I noticed that some views did overlap each other during and after resizing a window and cause redrawing. Then I did the same as the suggestion above to show the abs coordinates in a log table. After that, code did compare where and which views did touch each other. My mistake was that I did have a rounding error to resize the views. Not noing about your problem but anyway, HTH ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Figuring out what's causing redrawing
Right, but how do I catch what is causing the views on top to redisplay? I already tried breaking on the usual suspects and caught one view that was doing unnecessary redisplays, but even after fixing that I'm still getting a view in a completely different place that is constantly getting redrawn for no apparent reason. Just a longshot: did you override one of the 'display...' methods and fail to call super? If so, that might cause trouble. Paul Sanders. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Figuring out what's causing redrawing
On 15.05.2010, at 21:26, Nick Zitzmann wrote: Right, but how do I catch what is causing the views on top to redisplay? I already tried breaking on the usual suspects and caught one view that was doing unnecessary redisplays, but even after fixing that I'm still getting a view in a completely different place that is constantly getting redrawn for no apparent reason. override its drawRect: ? How else would you get the dirty rects to see what is dirtied? Cheers, -- Uli Kusterer The Witnesses of TeachText are everywhere... http://www.zathras.de ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Figuring out what's causing redrawing
On May 15, 2010, at 3:00 PM, Uli Kusterer wrote: override its drawRect: ? How else would you get the dirty rects to see what is dirtied? Right, but what is causing -drawRect: to be called? That's what I want to know. Nick Zitzmann http://www.chronosnet.com/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Figuring out what's causing redrawing
On 16.05.2010, at 00:46, Nick Zitzmann wrote: On May 15, 2010, at 3:00 PM, Uli Kusterer wrote: override its drawRect: ? How else would you get the dirty rects to see what is dirtied? Right, but what is causing -drawRect: to be called? That's what I want to know. How would I know? I was just saying that looking at the rects being redrawn each time could indicate what view is being redrawn that causes yours to be redrawn. Try it. What do you have to lose? Problems don't get solved by a magic bullet. You have to go on the hunt, close a circle ever tighter around it until you have the bug cornered. Occasionally you'll shoot in the bushes, but when something nearby moves, you're closer to your goal. That's what programming is all about. Cheers, -- Uli Kusterer The Witnesses of TeachText are everywhere... http://groups.yahoo.com/group/mac-gui-dev/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Figuring out what's causing redrawing
I've tried searching around but haven't found an answer to this. I have several views that are being constantly apparently needlessly redrawn and I can't figure out why this is happening. How do I catch the culprit that is causing the views to be redrawn? The redrawing is appearing in the usual place, within a call to -[NSWindow displayIfNeeded] in the run loop. I already tried the following: 1. Breaking on -[NSView setNeedsDisplayInRect:], but -drawRect: kept being called anyway, so whatever is causing this is circumventing this method. 2. Observing the value of -[NSView needsDisplay], but the value never changes, and it keeps getting redisplayed anyway. Apparently the value is a perpetual YES... Nick Zitzmann http://www.chronosnet.com/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com