zenity/entry_unix.go
2024-09-06 11:16:18 -04:00

23 lines
583 B
Go

//go:build !windows && !darwin
package zenity
import "git.bigun.dev/evan/zenity/internal/zenutil"
func entry(text string, opts options) (string, error) {
args := []string{"--entry", "--text", quoteMnemonics(text)}
args = appendGeneral(args, opts)
args = appendButtons(args, opts)
args = appendWidthHeight(args, opts)
args = appendWindowIcon(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)
}