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)

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top