• 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
Add MenuItem into Open Recent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Add MenuItem into Open Recent


  • Subject: Add MenuItem into Open Recent
  • From: Song-Bin Lin <email@hidden>
  • Date: Tue, 24 Feb 2004 03:31:16 +0800

Hi all,

I have a idea to improve my application more friendly by adding a
"Open All Recent" item. I hope this action can open all recent
documents which are show in Open Recent sub items. I expect my "Open
All Recent" item can insert into the first index that users can easy
understand what is this function. Unfortunate, I can. I add the menu
item during -applicationDidFinishLaunching: of the delegate of the
application for example:

- (void) applicationDidFinishLaunching:(NSNotification*) aNotification
{
int nIndex = [m_menuFile indexOfItemWithTarget:nil
andAction:@selector(openDocument:)];

if (nIndex >=0)
{
if(NSMenu* menuOpenRecent = [[m_menuFile itemAtIndex:nIndex+1]
submenu])
{
[menuOpenRecent insertItemWithTitle:@"Open All Recent"
action:@selector(fileOpenRecentAllRecent:) keyEquivalent:[NSString
string] atIndex:0];
[menuOpenRecent insertItem:[NSMenuItem separatorItem] atIndex:1];
}
}
}

After launching the application, the Open Recent sub menu is the same
as before never change. I only see the recent documents and "Clear
Menu".

If I use addItme to replace insertItem, the Open Recent is changed. I
can see the recent documents and "Open All Recent" but "Clear Menu"
disappears. Do I miss any thing?

lsb. 04.02.24.
_______________________________________________
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.

  • Prev by Date: NSTableView not responding to Drag and Drop events...
  • Next by Date: Re: [Slightly OT] Shareware donation collection
  • Previous by thread: NSTableView not responding to Drag and Drop events...
  • Next by thread: C strings?
  • Index(es):
    • Date
    • Thread