Пример #1
0
func (win *Window) Subpad(rows, cols, starty, startx int) (*Window, error) {
	spw, err := C.subpad((*C.WINDOW)(win), C.int(rows), C.int(cols), C.int(starty), C.int(startx))
	sp := (*Window)(spw)
	if err != nil && sp == nil {
		return nil, CursesError{fmt.Sprintf("subpad failed: %v", err)}
	}
	return sp, nil
}
Пример #2
0
// Sub creates a sub-pad h(eight) by w(idth) in size starting at the location
// y, x in the parent pad. Changes to a sub-pad will also change it's parent
func (p *Pad) Sub(y, x, h, w int) *Pad {
	return &Pad{&Window{C.subpad(p.win, C.int(h), C.int(w), C.int(y),
		C.int(x))}}
}