зеркало из https://github.com/electron/electron.git
1.0 KiB
1.0 KiB
Represented File for macOS BrowserWindows
On macOS a window can set its represented file, so the file's icon can show in the title bar and when users Command-Click or Control-Click on the title a path popup will show.
You can also set the edited state of a window so that the file icon can indicate whether the document in this window has been modified.
Represented file popup menu:
To set the represented file of window, you can use the BrowserWindow.setRepresentedFilename and BrowserWindow.setDocumentEdited APIs:
const { BrowserWindow } = require('electron')
const win = new BrowserWindow()
win.setRepresentedFilename('/etc/passwd')
win.setDocumentEdited(true)