Ejemplo n.º 1
0
func (win *Window) Copywin(sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol int, over bool) (*Window, error) {
	dst := new(Window)
	a := bool2cint(over)
	if C.copywin((*C.WINDOW)(win), (*C.WINDOW)(dst), C.int(sminrow), C.int(smincol), C.int(dminrow), C.int(dmincol), C.int(dmaxrow), C.int(dmaxcol), a) == C.ERR {
		return nil, CursesError{"copywin failed"}
	}
	return dst, nil
}
Ejemplo n.º 2
0
// Copy is similar to Overlay and Overwrite but provides a finer grain of
// control.
func (w *Window) Copy(src *Window, sy, sx, dtr, dtc, dbr, dbc int,
	overlay bool) error {
	var ol int
	if overlay {
		ol = 1
	}
	if C.copywin(src.win, w.win, C.int(sy), C.int(sx),
		C.int(dtr), C.int(dtc), C.int(dbr), C.int(dbc), C.int(ol)) ==
		C.ERR {
		return errors.New("Failed to copy window")
	}
	return nil
}