zenity/entry.go

22 lines
613 B
Go
Raw Permalink Normal View History

2021-03-04 21:01:59 -05:00
package zenity
// Entry displays the text entry dialog.
//
2021-03-05 10:14:30 -05:00
// Valid options: Title, Width, Height, OKLabel, CancelLabel, ExtraButton,
// Icon, EntryText, HideText.
2022-03-25 20:58:27 -04:00
//
// May return: ErrCanceled, ErrExtraButton.
2021-04-29 11:05:28 -04:00
func Entry(text string, options ...Option) (string, error) {
2021-03-04 21:01:59 -05:00
return entry(text, applyOptions(options))
}
// EntryText returns an Option to set the entry text.
func EntryText(text string) Option {
return funcOption(func(o *options) { o.entryText = text })
}
// HideText returns an Option to hide the entry text.
func HideText() Option {
return funcOption(func(o *options) { o.hideText = true })
}