Electron dialog.showMessageBox not displaying correctly

I am developing an app with Electron and need to display a message box to the user. This is the code I have:

const   electron = require('electron')
const   dialog = electron.dialog

        dialog.showMessageBox(BrowserWindow, {
            type: "info",
            buttons: ["OK", "Cancel"],
            title: "Importer Finished",
            message: "All done",
            detail: "Open you imported project in the IDE"
        }, resp => {

        })

Open in new window


The message box displayed does not follow the options, see the attached snippet.

I hope someone can point me in the right direction to fix this, thanks,
Sid
a-1.PNG
Sid PriceSoftware Systems Architect/DesignerAsked:
Who is Participating?
 
Sid PriceSoftware Systems Architect/DesignerAuthor Commented:
I resolved this ... my mistake was using "browserWindow", a class name in the message box call rather than an instance of the class "browserWindow."

Bitten by the "loose" type-checking of node.js/Javascript.
Sid
1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.