Re: Update NSMenuItem while displaying
Re: Update NSMenuItem while displaying
- Subject: Re: Update NSMenuItem while displaying
- From: "Jere Gmail" <email@hidden>
- Date: Tue, 6 May 2008 20:49:02 +0200
Thanks, it worked with this line:
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSEventTrackingRunLoopMode];
On Sat, May 3, 2008 at 2:50 PM, Ricky Sharp <email@hidden> wrote:
>
> On May 3, 2008, at 7:31 AM, Jere Gmail wrote:
>
>> I have a NSMenuItem int a NSStatusBarItem that displays the remaining
>> time of a timer. It is only updated when I'm not viewing the menu.
>> When I click in the menu, I can see in the debug console that no there
>> are no calls to the timer loop function.
>> How can I solve it?
>
>
> When you're adding your timer to the run loop, I think you've only specified
> the NSDefaultRunLoopMode. In addition to that, add the timer with a second
> mode of NSEventTrackingRunLoopMode.
>
> See addTimer:forMode:
>
>
> If using 10.5 and later, there appears to be a new mode
> (NSRunLoopCommonModes). I have not used that myself, but check the docs to
> see if it may apply to you.
>
> ___________________________________________________________
> Ricky A. Sharp mailto:email@hidden
> Instant Interactive(tm) http://www.instantinteractive.com
>
>
--
http://zon7blog.wordpress.com/
And again we fall.
_______________________________________________
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