Textarea
Textarea create a textarea and return its value.
API
Interface
func Textarea(c *tgframe.Container, label string, conf ...*TextareaConf) string
Parameters
cis Parent container.labelis the label for textarea.confis an optional configuration, at most one.
// TextareaConf is the configuration for a textarea.
type TextareaConf struct {
tgframe.Base // ID
// Height is the height of the textarea. default value is 3.
Height int
// Default is the default value of the textarea.
Default string
// ResetKey drops the app user's input and restores Default whenever it
// changes, e.g. a hash of the file the text was filled from.
ResetKey string
// Color defines the color of the textarea
Color tcutil.Color
}
Example
textareaValue := tgcomp.Textarea(p.Main, "Textarea",
&tgcomp.TextareaConf{
Height: 5,
Color: tcutil.ColorWarning,
})
tgcomp.Text(p.Main, "Value: "+textareaValue,
&tgcomp.TextConf{ID: "textarea_result"})
