Re: Open Recent menu in non-doc app
Re: Open Recent menu in non-doc app
- Subject: Re: Open Recent menu in non-doc app
- From: Ali Ozer <email@hidden>
- Date: Fri, 22 Mar 2002 09:11:27 -0800
>
> The menu is populated properly by calling
>
>
>
> [[NSDocumentController sharedDocumentController]
>
> noteNewRecentDocumentURL: [NSURL fileURLWithPath:path] ];
>
>
>
> as soon as path is available.
>
>
>
> If I try to use the Open Recent menu I get the following error panel
>
>
>
> The recent document "EiffelTower_even_smaller.tif" in folder
>
> "/Users/jnesto02/Smaller samples" failed to open.
>
>
The menu is being populated properly, but the items that get put in the
>
menu are still going to be set up so that they try to open up an
>
NSDocument, and since you don't have any of that set up, the call fails
>
because NSDocumentController can't find any NSDocument class to use to
>
open up the file. This can probably be solved by subclassing
>
NSDocumentController and overriding the
>
openDocumentWithContentsOfFile:display: method. To get your subclass
>
to be used as the shared NSDocumentController, you should instantiate
>
it in your main nib file.
TextEdit uses the NSDocument recent menu stuff without an
NSDocumentController. The open requests end up going through the
NSApplication open delegate method. Just implementing that might be
enough.
Ali
_______________________________________________
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.