Small update

This commit is contained in:
2025-10-30 12:01:59 -05:00
parent 250e33f8e2
commit 4b179ba2f5

View File

@@ -23,6 +23,7 @@ package widgets
import (
"fmt"
"slices"
wh "git.bullercodeworks.com/brian/tcell-widgets/helpers"
"github.com/gdamore/tcell"
@@ -321,14 +322,7 @@ func (w *Menu) AddItems(iL ...*MenuItem) {
func (w *Menu) RemoveItems(iL ...*MenuItem) {
var wrk []*MenuItem
for i := range w.items {
var skip bool
for j := range iL {
if w.items[i] == iL[j] {
skip = true
break
}
}
if skip {
if slices.Contains(iL, w.items[i]) {
continue
}
wrk = append(wrk, w.items[i])