• 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
Re: turning on the 'Open Recent' attribute for an NSMenuItem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: turning on the 'Open Recent' attribute for an NSMenuItem


  • Subject: Re: turning on the 'Open Recent' attribute for an NSMenuItem
  • From: SA Dev <email@hidden>
  • Date: Wed, 6 Jul 2005 16:05:41 -0400


So ... you're trying to programmatically recreate it exactly as it normally is, or are you trying to put it somewhere else? If you're putting it back where it belongs, I don't see anything special about it in my working doc-based app.


Basically, it says, "Open Recent Document" in its title, a tag of zero, and it's got a submenu. In the submenu, it's got a "Clear Menu" item, targeting File's Owner's clearRecentDocuments: method.

I *think* this is one of those things that should "Just Work", because I see nothing remarkable. If you're trying to do it another way (ie, it's not the application's main menu), I couldn't tell you whether it'd work or not ...



On Jul 6, 2005, at 3:20 PM, Lindsey Spratt wrote:

SA Dev,

Yes, I did delete the "Open Recent" menu that was in MainMenu.nib. However, I don't want to put it back.

I have an app, XGP, that is building its main menu bar programmatically instead of relying on the NIB technology. XGP's "main menu" NIB is a trivial placeholder (it only consists of an application menu, "XGP"). All of the other menus, "File", "Edit", "Window", "Help", and the XGP-specific "Tools", are created by XGP after it's launched. I've been able to explicitly support "magic" Cocoa menus and menu items so far (the Windows menu, Undo and Redo items in the Edit menu), but "Open Recent" is being difficult.

Thanks for your interest,
Lindsey

On Jul 6, 2005, at 3:04 PM, SA Dev <email@hidden> wrote:


Lindsey:

   I'm not sure I understand the problem. Did you delete the original
Open Recent menu that was in the MainMenu.nib's menu? If so, create a
new nib and copy the menu for a quick fix. If there's more to the
problem, please elaborate.


On Jul 6, 2005, at 2:53 PM, Lindsey Spratt wrote:


I am trying to create an 'Open Recent' menu item so that the
NSDocumentController will recognize it and auto-update its submenu
(as it does for the 'Open Recent' menu item created by default in a
document-based app project). There does not appear to be any
documentation (in Panther) on how to set this attribute. I found a
discussion at http://developer.apple.com/qa/qa2001/qa1289.html that
indicates that the 'Open Recent' menu item should have an action of
@selector(openDocument:) and a target of nil. However, this does
not appear to be adequate: opening a document in my app (XGP) with
this setup does not register in the 'Open Recent' submenu.

Thanks,
Lindsey


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


This email sent to email@hidden


_______________________________________________ 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
References: 
 >Re: turning on the 'Open Recent' attribute for an NSMenuItem (From: Lindsey Spratt <email@hidden>)

  • Prev by Date: Re: turning on the 'Open Recent' attribute for an NSMenuItem
  • Next by Date: Re: NSUserDefaultsController and NSTextField
  • Previous by thread: Re: turning on the 'Open Recent' attribute for an NSMenuItem
  • Next by thread: Referencing an instance variable in a class method
  • Index(es):
    • Date
    • Thread