Re: wits end with nsview and nsrectfill()
Re: wits end with nsview and nsrectfill()
- Subject: Re: wits end with nsview and nsrectfill()
- From: Graham Cox <email@hidden>
- Date: Fri, 05 Dec 2014 08:44:16 +1100
> On 5 Dec 2014, at 1:43 am, Navneet Kumar <email@hidden> wrote:
>
> 1. If a view is send the msg -display, is the msg sent to all its subviews without exception?
> 2. Could it be that so many views when trying to display (in the main thread of course), could block some views from refreshing altogether?
>
> If I could get a few pointers, I might get to the bottom of this problem.
Are *you* sending the -display message? Why? It's very unusual to do that.
The normal way to update a view is to mark as needing display with -setNeedsDisplay:, then the main loop causes redisplay as part of its normal functioning. Note that many types of view subclass, such as controls (including text fields) invoke -setNeedsDisplay: as part of setting a new value, so you only need to do this for custom view subclasses or other special requirements.
Unlike -display, it's harmless to "over invoke" -setNeedsDisplay, as there will still only be one redisplay per main cycle. If your code is calling -display directly, then it's probable that views are getting repainted too much, and that's often a problem for anything containing text or transparent backgrounds, because pixels get painted over more than once, darkening them. Sounds like what you could be seeing.
TL; DR: if you're invoking -display, you're doing it wrong™
--Graham
_______________________________________________
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