Documentation ¶
Index ¶
- type Checklist
- func (list *Checklist) Add(checked bool, text string)
- func (list *Checklist) CheckedItems() []*ChecklistItem
- func (list *Checklist) Delete()
- func (list *Checklist) Demote()
- func (list *Checklist) IsSelectable() bool
- func (list *Checklist) IsUnselectable() bool
- func (list *Checklist) Len() int
- func (list *Checklist) Less(i, j int) bool
- func (list *Checklist) LongestLine() int
- func (list *Checklist) Next()
- func (list *Checklist) Prev()
- func (list *Checklist) Promote()
- func (list *Checklist) Selected() int
- func (list *Checklist) SelectedItem() *ChecklistItem
- func (list *Checklist) SetSelectedByItem(selectableItem *ChecklistItem)
- func (list *Checklist) Swap(i, j int)
- func (list *Checklist) Toggle()
- func (list *Checklist) UncheckedItems() []*ChecklistItem
- func (list *Checklist) Unselect()
- func (list *Checklist) Update(text string)
- type ChecklistItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checklist ¶
type Checklist struct { Items []*ChecklistItem // contains filtered or unexported fields }
Checklist is a module for creating generic checklist implementations See 'Todo' for an implementation example
func NewChecklist ¶
func (*Checklist) CheckedItems ¶
func (list *Checklist) CheckedItems() []*ChecklistItem
CheckedItems returns a slice of all the checked items
func (*Checklist) Delete ¶
func (list *Checklist) Delete()
Delete removes the selected item from the checklist
func (*Checklist) Demote ¶
func (list *Checklist) Demote()
Demote moves the selected item DOWN in the checklist
func (*Checklist) IsSelectable ¶
IsSelectable returns true if the checklist has selectable items, false if it does not
func (*Checklist) IsUnselectable ¶
IsUnselectable returns true if the checklist has no selectable items, false if it does
func (*Checklist) LongestLine ¶
LongestLine returns the length of the longest checklist item's text
func (*Checklist) Next ¶
func (list *Checklist) Next()
Next selects the next item DOWN in the checklist
func (*Checklist) Prev ¶
func (list *Checklist) Prev()
Prev selects the previous item UP in the checklist
func (*Checklist) Promote ¶
func (list *Checklist) Promote()
Promote moves the selected item UP in the checklist
func (*Checklist) SelectedItem ¶
func (list *Checklist) SelectedItem() *ChecklistItem
SelectedItem returns the currently-selected checklist item or nil if no item is selected
func (*Checklist) SetSelectedByItem ¶
func (list *Checklist) SetSelectedByItem(selectableItem *ChecklistItem)
func (*Checklist) Toggle ¶
func (list *Checklist) Toggle()
Toggle switches the checked state of the currently-selected item
func (*Checklist) UncheckedItems ¶
func (list *Checklist) UncheckedItems() []*ChecklistItem
UncheckedItems returns a slice of all the unchecked items
type ChecklistItem ¶
ChecklistItem is a module for creating generic checklist implementations See 'Todo' for an implementation example
func NewChecklistItem ¶
func NewChecklistItem(checked bool, text string, checkedIcon, uncheckedIcon string) *ChecklistItem
func (*ChecklistItem) CheckMark ¶
func (item *ChecklistItem) CheckMark() string
CheckMark returns the string used to indicate a ChecklistItem is checked or unchecked
func (*ChecklistItem) Toggle ¶
func (item *ChecklistItem) Toggle()
Toggle changes the checked state of the ChecklistItem If checked, it is unchecked. If unchecked, it is checked