Patchset ps-107
feat(vxfw/list): ability to set cursor
Eric Bower
vxfw/list/list.go
+5
-0
feat(vxfw/list): ability to set cursor
This allows end-developers the ability to set the currently selected list item.
vxfw/list/list.go
link
+5
-0
+5
-0
1diff --git a/vxfw/list/list.go b/vxfw/list/list.go
2index 2315c28..3c25d24 100644
3--- a/vxfw/list/list.go
4+++ b/vxfw/list/list.go
5@@ -40,6 +40,11 @@ type scroll struct {
6 wantsCursor bool
7 }
8
9+func (d *Dynamic) SetCursor(c uint) {
10+ d.cursor = c
11+ d.ensureScroll()
12+}
13+
14 func (d *Dynamic) CaptureEvent(ev vaxis.Event) (vxfw.Command, error) {
15 if d.DisableEventHandlers {
16 return nil, nil