You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
369 B
27 lines
369 B
package main |
|
|
|
import ( |
|
"strings" |
|
|
|
"github.com/rivo/tview" |
|
) |
|
|
|
func NewCmdBar(app *App, view *tview.InputField) *CmdBar { |
|
return &CmdBar{ |
|
app: app, |
|
View: view, |
|
} |
|
} |
|
|
|
type CmdBar struct { |
|
app *App |
|
View *tview.InputField |
|
} |
|
|
|
func (c *CmdBar) GetInput() string { |
|
return strings.TrimSpace(c.View.GetText()) |
|
} |
|
|
|
func (c *CmdBar) ClearInput() { |
|
c.View.SetText("") |
|
}
|
|
|