mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-31 06:13:55 +00:00
update ShowAlert optimize return code
This commit is contained in:
parent
4fe4fe8b22
commit
06ad6eb8a1
@ -311,7 +311,7 @@ func main() {
|
||||
}
|
||||
|
||||
abool := robotgo.ShowAlert("test", "robotgo")
|
||||
if abool == 0 {
|
||||
if abool {
|
||||
fmt.Println("ok@@@ ", "ok")
|
||||
}
|
||||
|
||||
|
@ -308,7 +308,7 @@ func main() {
|
||||
}
|
||||
|
||||
abool := robotgo.ShowAlert("test", "robotgo")
|
||||
if abool == 0 {
|
||||
if abool {
|
||||
fmt.Println("ok@@@ ", "ok")
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
func alert() {
|
||||
// show Alert Window
|
||||
abool := robotgo.ShowAlert("hello", "robotgo")
|
||||
if abool == 0 {
|
||||
if abool {
|
||||
fmt.Println("ok@@@", "ok")
|
||||
}
|
||||
robotgo.ShowAlert("hello", "robotgo", "Ok", "Cancel")
|
||||
|
@ -1361,7 +1361,7 @@ ____ __ ____ __ .__ __. _______ ______ ____ __ ____
|
||||
*/
|
||||
|
||||
// ShowAlert show a alert window
|
||||
func ShowAlert(title, msg string, args ...string) int {
|
||||
func ShowAlert(title, msg string, args ...string) bool {
|
||||
var (
|
||||
// title string
|
||||
// msg string
|
||||
@ -1392,7 +1392,7 @@ func ShowAlert(title, msg string, args ...string) int {
|
||||
C.free(unsafe.Pointer(adefaultButton))
|
||||
C.free(unsafe.Pointer(acancelButton))
|
||||
|
||||
return ibool
|
||||
return ibool == 0
|
||||
}
|
||||
|
||||
// IsValid valid the window
|
||||
|
@ -19,7 +19,7 @@ import (
|
||||
|
||||
func aRobotgo() {
|
||||
abool := robotgo.ShowAlert("test", "robotgo")
|
||||
if abool == 0 {
|
||||
if abool {
|
||||
fmt.Println("ok@@@", "ok")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user