()
| 3 | import termbox "github.com/nsf/termbox-go" |
| 4 | |
| 5 | func (form *Form) Init() { |
| 6 | widgets := ReflectLoadWidgets(form.Record) |
| 7 | |
| 8 | form.Components = nil |
| 9 | form.FocusedIndex = -1 |
| 10 | |
| 11 | form.Components = nil |
| 12 | for _, w := range widgets { |
| 13 | form.Components = append(form.Components, |
| 14 | &Component{Widget: w}) |
| 15 | } |
| 16 | form.UpdateLayout() |
| 17 | |
| 18 | form.TabFocus(1) |
| 19 | } |
| 20 | |
| 21 | func (form *Form) UpdateLayout() { |
| 22 | form.ClientRect = form.BoundsRect |
no test coverage detected