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

Open Recent Menu


  • Subject: Open Recent Menu
  • From: "Jeff Bland" <email@hidden>
  • Date: Tue, 14 Aug 2007 01:51:19 -0600

Hello,

I'm trying to create a open recent menu in an application. The application
is not currently document based, because I've had no reason to make it
document based. It's also not really a document based application - it opens
one file at once, in one window, and doesn't do any editing or saving to the
files it opens.

So I've been searching Apple lists and developer documentation on how to do
this, and there's been lots of topics on Apple lists about it, however I
couldn't find an answer to my question.

How do you make Cocoa manage the Open Recent menu? All the topics and
documentation say to use

[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:]]

to add things to the recently opened items list. Which I was already doing
(found it in TextEdit), and my testing shows that is working fine.

So I can build a list of recently opened topics. That's good. Now I want to
put that list in a menu, and I can't find anything on how (I must be missing
something obvious since this just seems to go unstated - please forgive me
if I am).

I can loop through the results of recentDocumentURLs and build the menu
myself, but I see that TextEdit doesn't do that.

I can't find any [document_controller setRecentlyOpenedMenu:my_menu] option,
so perhaps Cocoa just seeks for a menu item called "Open Recent" and sticks
stuff in the menu attached to that item. So I tried making a menu item with
that name and a menu attached to it with the same name, and nothing happened
with that.

I am implementing the applications delegate openFile function.

Thanks for your help,

- Jeff
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: CGImageRef to bitmap context? [SOLVED]
  • Next by Date: dump NSOpenGLPixelFormat
  • Previous by thread: Re: NSTextView scroll button problem
  • Next by thread: Re: Open Recent Menu
  • Index(es):
    • Date
    • Thread