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)
}

{Code:-1 Text:This is my answer Index:0 Values:[] Error:}
Struct #
Code descriptions:
Code
status-1
means user pressed “OK” in a dialog windowCode
status-2
means user pressed “CANCEL”, pressedESC
or 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