1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Re-add command line help

This commit is contained in:
Sean Smith
2019-05-11 19:40:24 -04:00
parent 7f3daaac59
commit cd35d1e0a3
22 changed files with 108 additions and 6 deletions

View File

@@ -112,6 +112,10 @@ func (widget *BarGraph) TextView() *tview.TextView {
return widget.View
}
func (widget *BarGraph) HelpText() string {
return "No help available for this widget"
}
/* -------------------- Unexported Functions -------------------- */
func (widget *BarGraph) addView() *tview.TextView {

View File

@@ -78,7 +78,7 @@ func (widget *KeyboardWidget) InputCapture(event *tcell.EventKey) *tcell.EventKe
return event
}
func (widget *KeyboardWidget) helpText() string {
func (widget *KeyboardWidget) HelpText() string {
str := "Keyboard commands for " + widget.settings.Module.Type + "\n\n"
@@ -99,7 +99,7 @@ func (widget *KeyboardWidget) ShowHelp() {
widget.app.SetFocus(widget.view)
}
modal := NewBillboardModal(widget.helpText(), closeFunc)
modal := NewBillboardModal(widget.HelpText(), closeFunc)
widget.pages.AddPage("help", modal, false, true)
widget.app.SetFocus(modal)

View File

@@ -119,6 +119,10 @@ func (widget *TextWidget) Redraw(title, text string, wrap bool) {
})
}
func (widget *TextWidget) HelpText() string {
return fmt.Sprintf("\n There is no help available for this widget")
}
/* -------------------- Unexported Functions -------------------- */
func (widget *TextWidget) addView() *tview.TextView {

View File

@@ -14,6 +14,7 @@ type Wtfable interface {
Name() string
SetFocusChar(string)
TextView() *tview.TextView
HelpText() string
Height() int
Left() int