diff --git a/modal.go b/modal.go index f359a14..2b10d94 100644 --- a/modal.go +++ b/modal.go @@ -126,6 +126,12 @@ func (m *Modal) ClearButtons() *Modal { return m } +// SetFocus shifts the focus to the button with the given index. +func (m *Modal) SetFocus(index int) *Modal { + m.form.SetFocus(index) + return m +} + // Focus is called when this primitive receives focus. func (m *Modal) Focus(delegate func(p Primitive)) { delegate(m.form) diff --git a/textview.go b/textview.go index cac80a9..1e4a55f 100644 --- a/textview.go +++ b/textview.go @@ -298,8 +298,9 @@ func (t *TextView) SetRegions(regions bool) *TextView { // SetChangedFunc sets a handler function which is called when the text of the // text view has changed. This is useful when text is written to this io.Writer -// in a separate goroutine. This does not automatically cause the screen to be -// refreshed so you may want to use the "changed" handler to redraw the screen. +// in a separate goroutine. Doing so does not automatically cause the screen to +// be refreshed so you may want to use the "changed" handler to redraw the +// screen. // // Note that to avoid race conditions or deadlocks, there are a few rules you // should follow: