Exemple #1
0
func (win *Window) Getstr() (str string, err os.Error) {
	cstr := C.CString(str)
	//defer C.free(unsafe.Pointer(cstr))
	if C.wgetstr((*C.WINDOW)(win), cstr) == -1 {
		return "", CursesError{"wgetstr failed"}
	}
	s := C.GoString(cstr)
	return s, nil
}
Exemple #2
0
/* Gets a string from input. Buffering stops when a newline, carriage return, or EOF is encountered. */
func (w *Window) GetStr() (str string) {
	cstr := C.CString(str)
	C.wgetstr((*C.WINDOW)(w), cstr)
	str = C.GoString(cstr)
	return
}