• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
menuHeedsUpdate: and mouse down
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

menuHeedsUpdate: and mouse down


  • Subject: menuHeedsUpdate: and mouse down
  • From: Mark Alldritt <email@hidden>
  • Date: Thu, 13 Oct 2005 14:59:40 -0700
  • Thread-topic: menuHeedsUpdate: and mouse down

Hi All,

I have a menu that I build dynamically in a menuNeedsUpdate: delegate
method.  The problem is that this menu can at times take a little time (~1-2
seconds) to build.  The problem is that menuNeedsUpdate: gets called when
the user is simply tying into a text field.  Since my menu does not have any
key equiv. characters, its items can only be selected by the mouse.

So, how does one detect when menuNeedsUpdate: is being called for a mouse
down in a menu vs a key stroke.  I've tried this:

- (void) menuNeedsUpdate:(NSMenu*) menu
{
    NSEventType eType = [[NSApp currentEvent] type];

    if (menu == mOpenDictionaryMenu && eType == NSSystemDefined)
    {
        //  code to rebuild the menu
    }
}

But, eType is always NSSystemDefined.

Is there something else I can use to check for the mouse down?

Cheers
-Mark

------------------------------------------------------------------------
Mark Alldritt                      Late Night Software Ltd.
Phone: 250-380-1725                Script Debugger 3.0 - AppleScript IDE
WEB:  http://www.latenightsw.com/  FaceSpan 4.2 - AppleScript RAD
                                   Affrus 1.0 - Perl Debugging


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: SyncServices.framework
  • Next by Date: Re: Disk image won't open under pre-Panther
  • Previous by thread: Re: Reacting on changed NSPopupButton
  • Next by thread: Problem displaying accented characters in NSTextView
  • Index(es):
    • Date
    • Thread