ui

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2014 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultUi

type DefaultUi struct {
	// foreground color.
	Fg termbox.Attribute

	// background color.
	Bg termbox.Attribute

	// alert string.
	AlertString string
}

func (*DefaultUi) Clear

func (ui *DefaultUi) Clear()

sugar

func (*DefaultUi) Cursor

func (ui *DefaultUi) Cursor(x int, y int)

sugar

func (*DefaultUi) Flush

func (ui *DefaultUi) Flush()

sugar

func (*DefaultUi) PrintLine

func (ui *DefaultUi) PrintLine(str string, x int, y int) int

given a string, this func print them to the terminal, return the total width of the string.

func (*DefaultUi) PrintLines

func (ui *DefaultUi) PrintLines(lines []Todo, x, y int)

a function to print N slices to the screen.

type Todo added in v0.7.0

type Todo struct {
	// file name.
	Filename string

	// content
	Content string

	// line number
	LineNumber int

	// foreground color.
	Fg termbox.Attribute

	// background color.
	Bg termbox.Attribute
}

type Todo present a togo task.

func NewTodo added in v0.7.0

func NewTodo(content, filename string) Todo

type Ui

type Ui interface {
	// print one line to given position.
	PrintLine(str string, x, y int)

	// print lines to given position.
	PrintLines(lines []string, x, y int)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL