質問

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