zenity/entry_darwin.go

21 lines
537 B
Go
Raw Permalink Normal View History

2021-03-04 21:01:59 -05:00
package zenity
import (
"github.com/ncruces/zenity/internal/zenutil"
)
2021-03-05 21:07:00 -05:00
func entry(text string, opts options) (string, bool, error) {
2021-03-04 21:01:59 -05:00
var data zenutil.Dialog
data.Text = text
data.Operation = "displayDialog"
data.Options.Title = opts.title
data.Options.Answer = &opts.entryText
data.Options.Hidden = opts.hideText
data.Options.Timeout = zenutil.Timeout
2021-04-06 07:35:22 -04:00
data.Options.Icon = opts.icon.String()
data.SetButtons(getButtons(true, true, opts))
2021-03-04 21:01:59 -05:00
out, err := zenutil.Run(opts.ctx, "dialog", data)
2021-04-08 11:43:14 -04:00
return strResult(opts, out, err)
2021-03-05 21:07:00 -05:00
}