menuHeedsUpdate: and mouse down
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