Creates a dialog with a specified title.
Usage #
Let’s create a dialog with title “This is a test” and print out the result.
package main
import (
"fmt"
t "github.com/hugmouse/gotermux"
)
func main() {
result := t.TermuxDialog("This is a test")
fmt.Printf("%+v", result)
}
Output: {Code:-1 Text:This is my answer Index:0 Values:[] Error:}Struct #
Code descriptions:
Codestatus-1means user pressed “OK” in a dialog windowCodestatus-2means user pressed “CANCEL”, pressedESCor tapped out of the dialog window
Function returns TResult:
| Field | Type | Description |
|---|---|---|
Code | int8 | -2, -1 or 0, error code description depends on the function |
Text | string | Text that user wrote into a message dialog |
Index | uint | Dialog window index |
Values | []TValue | Unused for TermuxDialog |
Error | string | Unused for TermuxDialog |
Termux API reference #
termux-dialog