Documentation
¶
Index ¶
- Constants
- Variables
- func DrawBox(s tcell.Screen, x1, y1, x2, y2 int, style tcell.Style, text string)
- func DrawHLine(s tcell.Screen, y, x1, x2 int, style tcell.Style)
- func DrawText(s tcell.Screen, x1, y1, x2, y2 int, style tcell.Style, text string)
- func DrawVLine(s tcell.Screen, x, y1, y2 int, style tcell.Style)
- func DrawVLineL(s tcell.Screen, x, y1, y2 int, style tcell.Style)
- func DrawVLineR(s tcell.Screen, x, y1, y2 int, style tcell.Style)
- func NewScreen() tcell.Screen
- type Box
- type Command
- type CommandLine
- func (self *CommandLine) Add(char string)
- func (self *CommandLine) Clear(s tcell.Screen)
- func (self *CommandLine) Del()
- func (self *CommandLine) Draw(screen tcell.Screen)
- func (self *CommandLine) GetCommand() Command
- func (self *CommandLine) GetPromptResult() bool
- func (self *CommandLine) GetText() string
- func (self *CommandLine) HistoryAdd(str string)
- func (self *CommandLine) IsError() bool
- func (self *CommandLine) IsPrompt() bool
- func (self *CommandLine) IsSelected() bool
- func (self *CommandLine) Next()
- func (self *CommandLine) Prev()
- func (self *CommandLine) Reset()
- func (self *CommandLine) Sel()
- func (self *CommandLine) SetText(text string)
- func (self *CommandLine) ShowError(err string)
- func (self *CommandLine) ShowPrompt(prompt string)
- func (self *CommandLine) Unsel()
- type List
- func (self *List) Delete(i int)
- func (self *List) Draw(screen tcell.Screen)
- func (self *List) Filter(find string)
- func (self *List) FindMarks(mark rune) []int
- func (self *List) GetCoords() (x1, y1, x2, y2 int)
- func (self *List) GetId() int
- func (self *List) GetIndex() int
- func (self *List) GetLen() int
- func (self *List) GetSizes() (w, h int)
- func (self *List) GotoFirst()
- func (self *List) GotoLast()
- func (self *List) HalfDown()
- func (self *List) HalfUp()
- func (self *List) IsSelected() bool
- func (self *List) Next()
- func (self *List) Prev()
- func (self *List) Sel()
- func (self *List) SetEntries(entries []ListEntry)
- func (self *List) SetEntry(entry ListEntry, index int)
- func (self *List) SetIndex(i int)
- func (self *List) SetMark(mark rune, style tcell.Style, index int)
- func (self *List) SetSizes(x1, y1, x2, y2 int)
- func (self *List) Unsel()
- type ListEntry
- type Text
- func (self *Text) Draw(screen tcell.Screen)
- func (self *Text) GetCoords() (x1, y1, x2, y2 int)
- func (self *Text) GetSizes() (w, h int)
- func (self *Text) IsSelected() bool
- func (self *Text) Next()
- func (self *Text) Prev()
- func (self *Text) Sel()
- func (self *Text) SetSizes(x1, y1, x2, y2 int)
- func (self *Text) SetText(text string)
- func (self *Text) Unsel()
- type UI
- type UIData
Constants ¶
View Source
const ( CitationDelete = ":delete" CitationOpen = ":open" CitationOpenUrl = ":open-url" CitationOpenFile = ":open-file" CmdLineClose = ":cmdl-close" CmdLineDelete = ":cmdl-delete" CmdLineNext = ":cmdl-next" CmdLineOpen = ":cmdl-open" CmdLinePrev = ":cmdl-prev" HelpNext = ":help-down" HelpPrev = ":help-up" HelpClose = ":help-close" HelpShow = ":help" ListEdit = ":edit" ListExecute = ":exec" ListFilter = ":filter" ListGotoFirst = ":goto-first" ListGotoLast = ":goto-last" ListHalfDown = ":down" ListHalfUp = ":up" ListMarkDelete = ":mark-delete" ListNext = ":next" ListPrev = ":prev" ListUnmark = ":unmark" Quit = ":quit" )
Variables ¶
View Source
var BLUE tcell.Style = tcell.StyleDefault.Foreground(tcell.NewRGBColor(129, 161, 193)).Background(tcell.ColorReset)
blue foreground
View Source
var DARK tcell.Style = tcell.StyleDefault.Foreground(tcell.NewRGBColor(28, 28, 28)).Background(tcell.ColorReset)
dark foreground (black)
View Source
var DIM tcell.Style = tcell.StyleDefault.Foreground(tcell.NewRGBColor(76, 86, 106)).Background(tcell.ColorReset)
dim foreground (grey)
View Source
var GREEN tcell.Style = tcell.StyleDefault.Foreground(tcell.NewRGBColor(163, 190, 140)).Background(tcell.ColorReset)
green foreground
View Source
var NORMAL tcell.Style = tcell.StyleDefault.Foreground(tcell.NewRGBColor(229, 233, 240)).Background(tcell.ColorReset)
white foreground
View Source
var ORANGE tcell.Style = tcell.StyleDefault.Foreground(tcell.NewRGBColor(208, 135, 112)).Background(tcell.ColorReset)
orange foreground
View Source
var PINK tcell.Style = tcell.StyleDefault.Foreground(tcell.NewRGBColor(180, 142, 173)).Background(tcell.ColorReset)
pink foreground
View Source
var RED tcell.Style = tcell.StyleDefault.Foreground(tcell.NewRGBColor(191, 97, 106)).Background(tcell.ColorReset)
red foreground
View Source
var YELLOW tcell.Style = tcell.StyleDefault.Foreground(tcell.NewRGBColor(235, 203, 139)).Background(tcell.ColorReset)
yellow foreground
Functions ¶
func DrawHLine ¶
func DrawHLine(s tcell.Screen, y, x1, x2 int, style tcell.Style)
draws horizontal line
func DrawVLine ¶
func DrawVLine(s tcell.Screen, x, y1, y2 int, style tcell.Style)
draws vertical line with connecting start and end
func DrawVLineL ¶
func DrawVLineL(s tcell.Screen, x, y1, y2 int, style tcell.Style)
draws left vertical line with corners
func DrawVLineR ¶
func DrawVLineR(s tcell.Screen, x, y1, y2 int, style tcell.Style)
draws right vertical line with corners
Types ¶
type CommandLine ¶
type CommandLine struct {
// contains filtered or unexported fields
}
very basic commandline that handles commands
func (*CommandLine) GetCommand ¶
func (self *CommandLine) GetCommand() Command
gets command at current index from history
func (*CommandLine) GetPromptResult ¶
func (self *CommandLine) GetPromptResult() bool
returns a boolean value result for the prompt
func (*CommandLine) HistoryAdd ¶
func (self *CommandLine) HistoryAdd(str string)
add a command to history
func (*CommandLine) IsError ¶
func (self *CommandLine) IsError() bool
checks whether commandline is in error mode
func (*CommandLine) IsPrompt ¶
func (self *CommandLine) IsPrompt() bool
checks whether commandline is in prompt mode
func (*CommandLine) IsSelected ¶
func (self *CommandLine) IsSelected() bool
whether widget is selected or not
type List ¶
type List struct {
// contains filtered or unexported fields
}
simple scrollable ui list
type ListEntry ¶
type ListEntry struct {
// contains filtered or unexported fields
}
func NewListEntry ¶
returns a new entry
type Text ¶
type Text struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.