zenity/entry_unix.go
2021-04-09 01:26:57 +01:00

25 lines
566 B
Go

// +build !windows,!darwin
package zenity
import (
"github.com/ncruces/zenity/internal/zenutil"
)
func entry(text string, opts options) (string, bool, error) {
args := []string{"--entry", "--text", text}
args = appendTitle(args, opts)
args = appendButtons(args, opts)
args = appendWidthHeight(args, opts)
args = appendIcon(args, opts)
if opts.entryText != "" {
args = append(args, "--entry-text", opts.entryText)
}
if opts.hideText {
args = append(args, "--hide-text")
}
out, err := zenutil.Run(opts.ctx, args)
return strResult(opts, out, err)
}