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:36:48 -0500
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.
}
Thanks.
- Philip
On Thursday, July 18, 2002, at 09:57 PM, Kyle Moffett wrote:
>
*This message was transferred with a trial version of CommuniGate(tm)
>
Pro*
>
On Thursday, July 18, 2002, at 09:25 PM, Philip George wrote:
>
> How can I combat this behavior now, without having to wait on Apple to
>
> fix a bug, which they may not even consider to be a bug?
>
>
>
> The bottom line (rephrased for clarity): I do not want menu tracking
>
> enabled (or at least I want it immediately disabled again) when users
>
> click on my statusitem.
>
>
>
> What are some possible solutions/workarounds?
>
>
If menu tracking is enabled/disabled by reception of a notification,
>
then:
>
>
Two possible solutions, depending on what order things happen in.
>
>
If the menu tracking notification goes out before you find out your
>
status item was clicked:
>
Send out a notification or whatever to disable menu-tracking on click.
>
>
If the menu tracking notification goes out after you find out your
>
status item was clicked,
>
keep a BOOL indicating the status of click (myBool = numclicks%2). If
>
you get a menu
>
tracking notification and myBool is YES, send out another one to cancel
>
it.
>
>
If I'm way of base here please forgive me,
>
Thanks, Kyle Moffett
_______________________________________________
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.