@@ -390,6 +390,7 @@ func (l *List) SelectedItemInView() bool {
390390}
391391
392392// SetSelected sets the selected item index in the list.
393+// It returns -1 if the index is out of bounds.
393394func (l *List) SetSelected(index int) {
394395 if index < 0 || index >= len(l.items) {
395396 l.selectedIdx = -1
@@ -415,31 +416,43 @@ func (l *List) IsSelectedLast() bool {
415416}
416417
417418// SelectPrev selects the previous item in the list.
418−func (l *List) SelectPrev() {
419+// It returns whether the selection changed.
420+func (l *List) SelectPrev() bool {
419421 if l.selectedIdx > 0 {
420422 l.selectedIdx--
423+ return true
421424 }
425+ return false
422426}
423427
424428// SelectNext selects the next item in the list.
425−func (l *List) SelectNext() {
429+// It returns whether the selection changed.
430+func (l *List) SelectNext() bool {
426431 if l.selectedIdx < len(l.items)-1 {
427432 l.selectedIdx++
433+ return true
428434 }
435+ return false
429436}
430437
431438// SelectFirst selects the first item in the list.
432−func (l *List) SelectFirst() {
439+// It returns whether the selection changed.
440+func (l *List) SelectFirst() bool {
433441 if len(l.items) > 0 {
434442 l.selectedIdx = 0
443+ return true
435444 }
445+ return false
436446}
437447
438448// SelectLast selects the last item in the list.
439−func (l *List) SelectLast() {
449+// It returns whether the selection changed.
450+func (l *List) SelectLast() bool {
440451 if len(l.items) > 0 {
441452 l.selectedIdx = len(l.items) - 1
453+ return true
442454 }
455+ return false
443456}
444457
445458// SelectedItem returns the currently selected item. It may be nil if no item