dashboard / erock/vaxis / feat(vxfw/list): ability to set cursor #49 rss

accepted · opened on 2025-03-02T14:19:50Z by erock
Help
checkout latest patchset:
ssh pr.pico.sh print pr-49 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print ps-X | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 49
add review to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add --review 49
accept PR:
ssh pr.pico.sh pr accept 49
close PR:
ssh pr.pico.sh pr close 49

Logs

erock created pr with ps-107 on 2025-03-02T14:19:50Z
erock changed status on 2025-03-13T14:53:20Z {"status":"accepted"}

Patchsets

ps-107 by erock on 2025-03-02T14:19:50Z

Patchset ps-107

feat(vxfw/list): ability to set cursor

Eric Bower
2025-03-02T14:18:48Z
Back to top

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
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
diff --git a/vxfw/list/list.go b/vxfw/list/list.go
index 2315c28..3c25d24 100644
--- a/vxfw/list/list.go
+++ b/vxfw/list/list.go
@@ -40,6 +40,11 @@ type scroll struct {
 	wantsCursor bool
 }
 
+func (d *Dynamic) SetCursor(c uint) {
+	d.cursor = c
+	d.ensureScroll()
+}
+
 func (d *Dynamic) CaptureEvent(ev vaxis.Event) (vxfw.Command, error) {
 	if d.DisableEventHandlers {
 		return nil, nil