Re: turning on the 'Open Recent' attribute for an NSMenuItem
Re: turning on the 'Open Recent' attribute for an NSMenuItem
- Subject: Re: turning on the 'Open Recent' attribute for an NSMenuItem
- From: Charilaos Skiadas <email@hidden>
- Date: Wed, 6 Jul 2005 15:04:34 -0500
On Jul 6, 2005, at 2: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.
First of all, wouldn't it be easier to leave the menus as is in IB,
and programmatically just edit what you want?
Anyway, with regards to your question, you mention the selector
openDocument: as per the discussion in the apple website. Reading
that discussion, I am led to believe that openDocument: has to do
with the "Open..." menu item, not the "Open Recent" menu item.
You might find it helpful to look at the NSDocumentController
documentation, perhaps:
- (NSArray *)recentDocumentURLs
and friends. You would almost certainly have to populate the menu
yourself.
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:
40math.uchicago.edu
This email sent to email@hidden
Haris
_______________________________________________
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