예제 #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
}
예제 #2
0
파일: ncurses.go 프로젝트: Olreich/ncurses
/* 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
}