func addToActionList(list *walk.ActionList, actions []*walk.Action) error { for _, a := range actions { if err := list.Add(a); err != nil { return err } } return nil }
func (b *Builder) deferBuildActions(actionList *walk.ActionList, items []MenuItem) { if len(items) > 0 { b.Defer(func() error { for _, item := range items { action, err := item.createAction(b, nil) if err != nil { return err } if err := actionList.Add(action); err != nil { return err } } return nil }) } }