Re: When is the 'Open Recent' submenu populated?
Re: When is the 'Open Recent' submenu populated?
- Subject: Re: When is the 'Open Recent' submenu populated?
- From: "John C. Randolph" <email@hidden>
- Date: Wed, 16 Mar 2005 11:50:13 -0800
On Mar 16, 2005, at 10:11 AM, Hamish Allan wrote:
Hi,
I'm looking to write code to assign key equivalents to items in
'Open Recent' in a document-based app (e.g., Cmd-1 for most recent,
Cmd-2 for secondmost, etc.). However, apparently this submenu isn't
yet populated when applicationDidFinishLaunching: is called. Can
anybody suggest a better delegate method to use?
I would try something like this in your delegate:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[self performSelector:@selector(checkRecentsMenu) withObject:nil
afterDelay:0];
}
- (void) checkRecentsMenu
{
// see if the menu has been populated when you get here...
}
This way, the app has not only been launched, it's also been through
the event loop once when you get to the -checkRecentsMenu method.
HTH,
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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