diff --git a/doc.md b/doc.md index b253298..94eac53 100644 --- a/doc.md +++ b/doc.md @@ -388,4 +388,4 @@ func main() { ####Return: - Returns True if the default button was pressed, or False if cancelled. + Returns 0(True) if the default button was pressed, or 1(False) if cancelled. diff --git a/robotgo.go b/robotgo.go index c19eb72..b7842b7 100644 --- a/robotgo.go +++ b/robotgo.go @@ -390,7 +390,7 @@ ____ __ ____ __ .__ __. _______ ______ ____ __ ____ \__/ \__/ |__| |__| \__| |_______/ \______/ \__/ \__/ */ -func ShowAlert(title, msg string, args ...string) { +func ShowAlert(title, msg string, args ...string) int { var ( // title string // msg string @@ -411,5 +411,7 @@ func ShowAlert(title, msg string, args ...string) { amsg := C.CString(msg) adefaultButton := C.CString(defaultButton) acancelButton := C.CString(cancelButton) - C.aShowAlert(atitle, amsg, adefaultButton, acancelButton) + cbool := C.aShowAlert(atitle, amsg, adefaultButton, acancelButton) + ibool := int(cbool) + return ibool } diff --git a/window/goWindow.h b/window/goWindow.h index 76311dd..cba518d 100644 --- a/window/goWindow.h +++ b/window/goWindow.h @@ -3,7 +3,7 @@ int aShowAlert(const char *title, const char *msg, const char *defaultButton, const char *cancelButton){ - showAlert(title,msg,defaultButton,cancelButton); + int alert=showAlert(title,msg,defaultButton,cancelButton); - return 0; + return alert; } \ No newline at end of file diff --git a/zh_doc.md b/zh_doc.md index a2b3fd7..800d803 100644 --- a/zh_doc.md +++ b/zh_doc.md @@ -402,4 +402,4 @@ func main() { ####Return: - Returns True if the default button was pressed, or False if cancelled. \ No newline at end of file + Returns 0(True) if the default button was pressed, or 1(False) if cancelled. \ No newline at end of file