func (w *Window) printf(x, y int, a Attributes, format string,
	args ...interface{}) {
	out := fmt.Sprintf(format, args...)
	xx := 0
	c := Cell{}
	c.Fg = a.Fg
	c.Bg = a.Bg
	mx := w.x - x
	var rw int
	for i := 0; i < len(out); i += rw {
		if x+xx+1 > mx {
			break
		}

		v, width := utf8.DecodeRuneInString(out[i:])
		if v == '\x1b' {
			// see if we understand this escape seqeunce
			cc, skip, err := DecodeColor(out[i:])
			if err == nil {
				c.Fg = cc.Fg
				c.Bg = cc.Bg
				rw = skip
				continue

			}
		}

		rw = width
		c.Ch = v
		w.setCell(x+xx, y, c)
		xx++
	}
}
func (w *Window) printf(x, y int, a Attributes, format string,
	args ...interface{}) {
	out := fmt.Sprintf(format, args...)
	xx := 0
	c := Cell{}
	c.Fg = a.Fg
	c.Bg = a.Bg
	mx := w.x - x
	var rw int
	for i := 0; i < len(out); i += rw {
		if x+xx+1 > mx {
			break
		}

		v, width := utf8.DecodeRuneInString(out[i:])
		if v == '\x1b' {
			
			cc, skip, err := DecodeColor(out[i:])
			if err == nil {
				c.Fg = cc.Fg
				c.Bg = cc.Bg
				rw = skip
				continue

			}
		}

		rw = width
		c.Ch = v
		w.setCell(x+xx, y, c)
		xx++
	}
}
func ( w * Window ) printf ( x , y int , a Attributes , format string , args ... interface { } ) { out := fmt . Sprintf ( format , args ... ) xx := 0 c := Cell { } c . Fg = a . Fg c . Bg = a . Bg mx := w . x - x var rw int for i := 0 ; i < len ( out ) ; i += rw { if x + xx + 1 > mx { break } v , width := utf8 . DecodeRuneInString ( out [ i : ] ) if v == '\x1b' { // see if we understand this escape seqeunce cc , skip , err := DecodeColor ( out [ i : ] ) if err == nil { c . Fg = cc . Fg c . Bg = cc . Bg rw = skip continue } } rw = width c . Ch = v w . setCell ( x + xx , y , c ) xx ++ } }
// printf prints into the backend buffer.
// This will not show immediately.
// printf shall be called from queue context.
printf prints into the backend buffer . This will not show immediately . printf shall be called from queue context .