|
||
---|---|---|
.gitignore | ||
LICENSE | ||
README.md | ||
index.html | ||
main.js | ||
package-lock.json | ||
package.json | ||
preload.js |
Electron Dialog
Electron Documention: https://www.electronjs.org/docs/api/dialog
Preview
Windows
Message Dialog:
Question Dialog:
Error Dialog:
macOS
No preview available, I don't own a mac :)
Linux
Message Dialog:
Question Dialog:
Error Dialog:
Dialogs
Message
const options = {
type: 'info',
title: 'Dialog',
message: 'Title of dialog.',
detail: 'Details for the message dialog.',
};
dialog.showMessageBox(null, options, (response, checkboxChecked) => {});
Question
const options = {
type: 'question',
buttons: ['Cancel', 'Option One', 'Option Two', 'Option Three'],
defaultId: 2,
title: 'Dialog',
message: 'Do you want to continue?',
detail: 'Choose any of the options below or cancel.',
checkboxLabel: 'This is a checkbox',
checkboxChecked: true,
};
dialog.showMessageBox(null, options, (response, checkboxChecked) => {});
Error Message
const options = {
type: 'error',
title: 'Dialog',
message: 'Title of error.',
detail: 'Details for the error dialog.',
};
dialog.showMessageBox(null, options, (response, checkboxChecked) => {});