label.go
func (l *Label) Render() {
	if l.visibility == VisibilityHide {
		l.clear()
		return
	}

	if !l.status {
		l.w.printf(l.trueX, l.trueY, l.attr, "%v", l.text)
		return
	}

	text := l.text
	spacing := l.w.x - len([]rune(text)) + EscapedLen(text)
	if spacing < 0 {
		spacing = 0
	}

	left := ""
	right := ""
	switch l.justify {
	case JustifyRight:
		left = strings.Repeat(" ", spacing)
	case JustifyLeft:
		right = strings.Repeat(" ", spacing)
	case JustifyCenter:
		left = strings.Repeat(" ", spacing/2)
		right = strings.Repeat(" ", spacing/2+spacing%2)
	}
	x := 0
	l.w.printf(x, l.trueY, l.attr, "%v%v%v", left, text, right)
}
func (l *Label) Render() {
	if l.visibility == VisibilityHide {
		l.clear()
		return
	}

	if !l.status {
		l.w.printf(l.trueX, l.trueY, l.attr, "%v", l.text)
		return
	}

	text := l.text
	spacing := l.w.x - len([]rune(text)) + EscapedLen(text)
	if spacing < 0 {
		spacing = 0
	}

	left := ""
	right := ""
	switch l.justify {
	case JustifyRight:
		left = strings.Repeat(" ", spacing)
	case JustifyLeft:
		right = strings.Repeat(" ", spacing)
	case JustifyCenter:
		left = strings.Repeat(" ", spacing/2)
		right = strings.Repeat(" ", spacing/2+spacing%2)
	}
	x := 0
	l.w.printf(x, l.trueY, l.attr, "%v%v%v", left, text, right)
}
func ( l * Label ) Render ( ) { if l . visibility == VisibilityHide { l . clear ( ) return } if ! l . status { l . w . printf ( l . trueX , l . trueY , l . attr , " " , l . text ) return } text := l . text spacing := l . w . x - len ( [ ] rune ( text ) ) + EscapedLen ( text ) if spacing < 0 { spacing = 0 } left := " " right := " " switch l . justify { case JustifyRight : left = strings . Repeat ( " " , spacing ) case JustifyLeft : right = strings . Repeat ( " " , spacing ) case JustifyCenter : left = strings . Repeat ( " " , spacing / 2 ) right = strings . Repeat ( " " , spacing / 2 + spacing % 2 ) } x := 0 l . w . printf ( x , l . trueY , l . attr , " " , left , text , right ) }
// Render implements the Render interface.  This is called from queue context
// so be careful to not use blocking calls.
Render implements the Render interface . This is called from queue context so be careful to not use blocking calls .