mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-04 16:03:54 +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")
|
abool := robotgo.ShowAlert("test", "robotgo")
|
||||||
if abool == 0 {
|
if abool {
|
||||||
fmt.Println("ok@@@ ", "ok")
|
fmt.Println("ok@@@ ", "ok")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
abool := robotgo.ShowAlert("test", "robotgo")
|
abool := robotgo.ShowAlert("test", "robotgo")
|
||||||
if abool == 0 {
|
if abool {
|
||||||
fmt.Println("ok@@@ ", "ok")
|
fmt.Println("ok@@@ ", "ok")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
func alert() {
|
func alert() {
|
||||||
// show Alert Window
|
// show Alert Window
|
||||||
abool := robotgo.ShowAlert("hello", "robotgo")
|
abool := robotgo.ShowAlert("hello", "robotgo")
|
||||||
if abool == 0 {
|
if abool {
|
||||||
fmt.Println("ok@@@", "ok")
|
fmt.Println("ok@@@", "ok")
|
||||||
}
|
}
|
||||||
robotgo.ShowAlert("hello", "robotgo", "Ok", "Cancel")
|
robotgo.ShowAlert("hello", "robotgo", "Ok", "Cancel")
|
||||||
|
@ -1361,7 +1361,7 @@ ____ __ ____ __ .__ __. _______ ______ ____ __ ____
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// ShowAlert show a alert window
|
// ShowAlert show a alert window
|
||||||
func ShowAlert(title, msg string, args ...string) int {
|
func ShowAlert(title, msg string, args ...string) bool {
|
||||||
var (
|
var (
|
||||||
// title string
|
// title string
|
||||||
// msg string
|
// msg string
|
||||||
@ -1392,7 +1392,7 @@ func ShowAlert(title, msg string, args ...string) int {
|
|||||||
C.free(unsafe.Pointer(adefaultButton))
|
C.free(unsafe.Pointer(adefaultButton))
|
||||||
C.free(unsafe.Pointer(acancelButton))
|
C.free(unsafe.Pointer(acancelButton))
|
||||||
|
|
||||||
return ibool
|
return ibool == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsValid valid the window
|
// IsValid valid the window
|
||||||
|
@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
func aRobotgo() {
|
func aRobotgo() {
|
||||||
abool := robotgo.ShowAlert("test", "robotgo")
|
abool := robotgo.ShowAlert("test", "robotgo")
|
||||||
if abool == 0 {
|
if abool {
|
||||||
fmt.Println("ok@@@", "ok")
|
fmt.Println("ok@@@", "ok")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user