draw

package
v0.0.0-...-1e2fe69 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HLine

func HLine(screen tcell.Screen, x, y, width int, style tcell.Style)

HLine draws a horizontal line

func Rect

func Rect(screen tcell.Screen, x, y, width, height int, style tcell.Style)

Rect draws a rectangle with the specified dimensions

func Text

func Text(screen tcell.Screen, x, y int, style tcell.Style, text string)

Text draws text at the specified position

func TextCentered

func TextCentered(screen tcell.Screen, x, y, width int, style tcell.Style, text string)

TextCentered draws text centered at the specified position

func TextRight

func TextRight(screen tcell.Screen, x, y, width int, style tcell.Style, text string)

TextRight draws text aligned to the right at the specified position

func VLine

func VLine(screen tcell.Screen, x, y, height int, style tcell.Style)

VLine draws a vertical line

Types

type Box

type Box struct {
	X, Y          int
	Width, Height int
	Title         string
	Round         bool
	Screen        tcell.Screen
	Style         tcell.Style
}

Box represents a box widget with borders

func NewBox

func NewBox(screen tcell.Screen, x, y, width, height int) *Box

NewBox creates a new box widget

func (*Box) Draw

func (b *Box) Draw()

Draw draws the box on the screen

func (*Box) InnerHeight

func (b *Box) InnerHeight() int

InnerHeight returns the inner height

func (*Box) InnerWidth

func (b *Box) InnerWidth() int

InnerWidth returns the inner width

func (*Box) InnerX

func (b *Box) InnerX() int

InnerX returns the inner X coordinate

func (*Box) InnerY

func (b *Box) InnerY() int

InnerY returns the inner Y coordinate

func (*Box) SetRound

func (b *Box) SetRound(round bool)

SetRound sets whether to use rounded corners

func (*Box) SetStyle

func (b *Box) SetStyle(style tcell.Style)

SetStyle sets the box style

func (*Box) SetTitle

func (b *Box) SetTitle(title string)

SetTitle sets the box title

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳