From 60a28c7f73cb61f22c40444c0f3d13a77c6da677 Mon Sep 17 00:00:00 2001 From: Eric Bower Date: Sun, 2 Mar 2025 09:18:48 -0500 Subject: [PATCH] feat(vxfw/list): ability to set cursor This allows end-developers the ability to set the currently selected list item. --- vxfw/list/list.go | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.45.3