Question

We have a custom window and titlebar for a document-based app, and we would like to support versioning with the standard disclosure button that appears beside the document title. Here is an image of the disclosure button and the popup menu when it is clicked (from TextEdit):

Grab of TextEdit versions disclosure button and popup menu

Is there a way to programmatically show this versions popup menu for a custom disclosure button?

A related question appears here, but with different criteria:

Cocoa - Adding menu to support versions? (Like in TextEdit)

Était-ce utile?

La solution

I think you can't show programmatically the system version menu, but you can create your own and call the NSDocument methods

- (void)lockDocument:(id)sender
- (void)duplicateDocument:(id)sender
- revertToContentsOfURL:ofType:error:
- (void)browseDocumentVersions:(id)sender

lockDocument and browseDocumentVersions require 10.8

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top