@@ -398,6 +398,22 @@ func (l *List) SetSelected(index int) {
398398 }
399399}
400400
401+// Selected returns the index of the currently selected item. It returns -1 if
402+// no item is selected.
403+func (l *List) Selected() int {
404+ return l.selectedIdx
405+}
406+
407+// IsSelectedFirst returns whether the first item is selected.
408+func (l *List) IsSelectedFirst() bool {
409+ return l.selectedIdx == 0
410+}
411+
412+// IsSelectedLast returns whether the last item is selected.
413+func (l *List) IsSelectedLast() bool {
414+ return l.selectedIdx == len(l.items)-1
415+}
416+
401417// SelectPrev selects the previous item in the list.
402418func (l *List) SelectPrev() {
403419 if l.selectedIdx > 0 {