mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
init column config menu
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user