Make messageboxes public
This commit is contained in:
@ -34,7 +34,7 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
func messageBox(title, text string) bool {
|
func MessageBox(title, text string) bool {
|
||||||
if runtime.GOOS == "linux" {
|
if runtime.GOOS == "linux" {
|
||||||
err := exec.Command("zenity", "--question", "--title", title, "--text", text).Run()
|
err := exec.Command("zenity", "--question", "--title", title, "--text", text).Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -31,7 +31,7 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func messageBox(title, text string) bool {
|
func MessageBox(title, text string) bool {
|
||||||
user32 := syscall.NewLazyDLL("user32.dll")
|
user32 := syscall.NewLazyDLL("user32.dll")
|
||||||
messageBoxW := user32.NewProc("MessageBoxW")
|
messageBoxW := user32.NewProc("MessageBoxW")
|
||||||
mbYesNo := 0x00000004
|
mbYesNo := 0x00000004
|
||||||
|
2
ui.go
2
ui.go
@ -150,7 +150,7 @@ func PromptDownload() {
|
|||||||
text := "No Firefox installation was found. Would you like to download and install it now?"
|
text := "No Firefox installation was found. Would you like to download and install it now?"
|
||||||
|
|
||||||
// Ask user for confirmation
|
// Ask user for confirmation
|
||||||
if !messageBox(title, text) {
|
if !MessageBox(title, text) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user