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

Open Recent menus


  • Subject: Open Recent menus
  • From: Mark Spano <email@hidden>
  • Date: Tue, 21 Jun 2005 22:06:13 -0400

I have a Cocoa document-based application that opens data files that fall into two categories: 
call them Flow and Section.  Unfortunately, there is no indication in the file extension or anywhere 
else as to which type any given file is (and no hope of getting the data supplier to tag the files).  
So I subclassed NSDocumentController as per the following advice on Apple's Document-Based 
Applications FAQ:

// If you need to customize the Open panel, you have encountered one of the clear times 
// when an NSDocumentController subclass is needed. You can override the NSDocumentController’s 
// runModalOpenPanel:forTypes: method to customize the panel or add an accessory view.

I then successfully added a customized Open panel.  The customization is simply a drop box that 
allows the user to indicate if the file is a Flow or a Section file.  

Now for the question:   I would like to allow a quick way of re-opening the file short of re-doing 
the Open panel.  The Open Recent menu item seems perfect for this, except that it doesn't
save the file type.  I suppose I could save a huge database of all files opened in the past by
all users and remember what type each file was, but that seems like work.  Instead I modified
the name of the Open Recent menu item to Open Recent (Flow) and made a second item
called Open Recent (Section).  Unfortunately, there I stalled.  I could find no way to select 
which one stored a recently opened file name.  Worse, Cocoa seems to randomly select which 
one it will use to store recent names.   Sometime one, sometimes the other, sometimes both.

Does Cocoa allow two Recent File items?  If so, how should this be implemented?
Any other comments / suggestions?

Many thanks,
   Mark


----------------------------------------


Dr. Mark L. Spano

Research Physicist


NSWC Carderock Laboratory

W. Bethesda, MD  20817


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

  • Prev by Date: enable NSPopupButton focus and tab key
  • Next by Date: Re: enable NSPopupButton focus and tab key
  • Previous by thread: Re: enable NSPopupButton focus and tab key
  • Next by thread: Re: Open Recent menus
  • Index(es):
    • Date
    • Thread