make cursor position modifiable from external packages

pull/893/head
DevHegemony 8 months ago
parent 9bc1d28d88
commit db2e247f91

@ -278,6 +278,17 @@ func (i *InputField) SetFormAttributes(labelWidth int, labelColor, bgColor, fiel
return i
}
// GetCursorPos gets the current offset for cursor from start of field.
func (i *InputField) GetCursorPos() (pos int) {
return i.cursorPos
}
// SetCursorPos sets the current offset for cursor from start of field.
func (i *InputField) SetCursorPos(pos int) *InputField {
i.cursorPos = pos
return i
}
// SetFieldWidth sets the screen width of the input area. A value of 0 means
// extend as much as possible.
func (i *InputField) SetFieldWidth(width int) *InputField {

Loading…
Cancel
Save