Re: NSStatusItem with no menu triggers menu tracking
Re: NSStatusItem with no menu triggers menu tracking
- Subject: Re: NSStatusItem with no menu triggers menu tracking
- From: Philip George <email@hidden>
- Date: Thu, 18 Jul 2002 22:53:17 -0500
didn't work. i tried several variations, but it behaves exactly the
same.
- Philip
On Thursday, July 18, 2002, at 10:46 PM, Kyle Moffett wrote:
>
On Thursday, July 18, 2002, at 11:36 PM, Philip George wrote:
>
> Kyle, actually you and I are on the same wavelength here. With this
>
> idea though, the problem is that I can't figure out exactly how
>
> trigger the counteraction event. I can trap the notification easily.
>
> I just don't know exactly what to do next. Here's what I've got to
>
> trap the notification. I only need a way to trigger the disabling of
>
> menu tracking once inside the handler method...
>
>
>
> ...
>
> // in my startup code
>
> [[NSDistributedNotificationCenter defaultCenter] addObserver:self
>
> selector:@selector(menuTrackingHandler:)
>
> name:@"com.apple.HIToolbox.beginMenuTrackingNotification"
>
> object:nil
>
>
>
> suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately];
>
> ....
>
>
>
> // in the same class...
>
> - (void)menuTrackingHandler:(NSNotification *)n {
>
> NSLog(@"%@",[n name]);
>
> // Okay, I can get to this point fine, but what do I do
>
> // inside this method to RE-trigger the opposite
>
> // event, thus disabling menu tracking?
>
> // that's the part I can't figure out.
>
// Try this:
>
[NSDistributedNotificationCenter defaultCenter]
>
postNotificationName:@"com.apple.HIToolbox.beginMenuTrackingNotification"
>
object:myStatusItem
>
userInfo:[n userInfo]
>
deliverImmediately:YES];
>
// It might not work, but you could try.
>
> }
>
>
>
> Thanks.
>
>
>
> - Philip
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.