asticode / go-astilectron

Build cross platform GUI apps with GO and HTML/JS/CSS (powered by Electron)
MIT License
4.9k stars 344 forks source link

"MessageBoxOnClose" doesn't seem to be working. #281

Closed NickTikhonov closed 4 years ago

NickTikhonov commented 4 years ago

Hey there,

I'm trying to add a confirm dialog when a window is closed on Windows:

MessageBoxOnClose: &astilectron.MessageBoxOptions{
    Type:      astilectron.MessageBoxTypeQuestion,
    Title:     "Confirm",
    Message:   options.ConfirmQuitMessage,
    Buttons:   []string{"Yes", "No"},
    ConfirmID: astikit.IntPtr(0),
}

This correctly displays a message box when quitting, however the window itself does not close and the application does not quit.

Do you know what might be causing this?

asticode commented 4 years ago

I was causing this 😆

I fixed the bug and bumped the whole ecosystem.

Can you confirm ?

NickTikhonov commented 4 years ago

Works great now!

Thank you :)

NickTikhonov commented 4 years ago

Looks like the fix worked - but I'm having an issue running an app with bootstrap after upgrading the dependencies. Clearing the vendor directory seemed to work, but not when testing the version with the old dependencies.

ERROR   Execution failed: starting astilectron failed: provisioning failed: provisioning astilectron failed: unzipping C:\Users\nicktikhonov\AppData\Roaming\App\vendor\astilectron-v0.37.0.zip\astilectron-0.37.0 into C:\Users\nicktikhonov\AppData\Roaming\App\vendor\astilectron failed: unzipping C:\Users\nicktikhonov\AppData\Roaming\App\vendor\astilectron-v0.37.0.zip\astilectron-0.37.0 into C:\Users\nicktikhonov\AppData\Roaming\App\vendor\astilectron failed: astikit: content in archive does not match specified internal path astilectron-0.37.0

Wondering if this is an issue with the ecosystem or something on our side

asticode commented 4 years ago

This usually happens when you forget to go install the bundler after having bumped all dependencies.

When bumping all dependencies you need to :

1) bump go-astilectron 2) bump go-astilectron-bundler 3) run go install ./astilectron-bundler 4) bump go-astilectron-bootstrap

And you should be good to go

NickTikhonov commented 4 years ago

That worked, thanks for the instructions 👍