func (w *Window) Print(text string) { C.waddstr(w.win, C.CString(strings.Map(func(r rune) rune { if r < 32 { return -1 } return r }, text))) }
func (win *Window) Addstr(str string) error { s := C.CString(str) defer C.free(unsafe.Pointer(s)) if C.waddstr((*C.WINDOW)(win), s) == C.ERR { return CursesError{"waddstr failed"} } return nil }
// Printf functions the same as the stardard library's fmt package. See Print // for more details. func (w *Window) Printf(format string, args ...interface{}) { cstr := C.CString(fmt.Sprintf(format, args...)) defer C.free(unsafe.Pointer(cstr)) C.waddstr(w.win, cstr) }
func (w *Window) Fill(str string) bool { return C.waddstr(w.win, C.CString(str)) == C.OK }
func (window *Window) Addstr(str ...interface{}) { res := (*C.char)(C.CString(fmt.Sprint(str...))) defer C.free(unsafe.Pointer(res)) C.waddstr(window.cwin, res) }
/* Prints at the cursor location string s. */ func (w *Window) Print(s string) { C.waddstr((*C.WINDOW)(w), C.CString(s)) }
func (w *CursesWindow) Fill(str string) FillReturn { if C.waddstr(w.impl, C.CString(str)) == C.OK { return FillContinue } return FillSuspend }