init column config menu

This commit is contained in:
Bradley Cicenas
2020-01-02 23:02:53 +00:00
parent ffb96f4e90
commit 7c6b5c54dc
9 changed files with 117 additions and 15 deletions

View File

@@ -55,6 +55,11 @@ func (m *Menu) DelItem(s string) (success bool) {
return success
}
// ClearItems removes all current menu items
func (m *Menu) ClearItems() {
m.items = m.items[:0]
}
// Move cursor to an position by Item value or label
func (m *Menu) SetCursor(s string) (success bool) {
for n, i := range m.items {
@@ -79,6 +84,10 @@ func (m *Menu) SelectedItem() Item {
return m.items[m.cursorPos]
}
func (m *Menu) SelectedValue() string {
return m.items[m.cursorPos].Val
}
func (m *Menu) Buffer() ui.Buffer {
var cell ui.Cell
buf := m.Block.Buffer()