Re: View does not get refreshed after Window deminimized...
Re: View does not get refreshed after Window deminimized...
- Subject: Re: View does not get refreshed after Window deminimized...
- From: cocoa learner <email@hidden>
- Date: Fri, 12 Mar 2010 08:30:20 +0530
Hummm... looks like my approach has flaw.
Thanks a ton,
Cocoa.learner
On Thu, Mar 11, 2010 at 11:52 PM, Quincey Morris <
email@hidden> wrote:
> On Mar 11, 2010, at 06:50, cocoa learner wrote:
>
> > And on this custom view I have a progress bar, that progressbar gets it's
> > progress value from a NSThread. And I am using following function render
> the
> > progressbar, from NSThread -
> >
> >
> > [progBar performSelectorOnMainThread: (display) withObject: nil
> > waitUntilDone: YES];
>
> There seem to be two things wrong here.
>
> First, you must *not* set the value of the progress bar from a non-main
> thread. Setting the value causes a UI update, and that won't work properly
> unless it's done on the main thread. Instead, you must devise a method for
> the background thread to pass the desired value to the main thread, and have
> the main thread set the progress bar value.
>
> Second, it's rarely correct to invoke [NSView display] yourself. Typically,
> you would use [NSView setNeedsDisplay].
>
> In any case, it's not clear why you think you need to cause the progress
> bar to redisplay. If you set the value properly from the main thread, it
> will redisplay itself as necessary. If you're having a problem with the
> animation not running, you just need to make sure you set (or re-set) the
> value often enough.
>
>
> _______________________________________________
>
> 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
>
_______________________________________________
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