Exemplo n.º 1
0
// NewPad creates a window which is not restricted by the terminal's
// dimentions (unlike a Window). Pads accept all functions which can be
// called on a window. It returns a pointer to a new Pad of h(eight) by
// w(idth).
func NewPad(h, w int) (*Pad, error) {
	p := C.newpad(C.int(h), C.int(w))
	if p == nil {
		return nil, errors.New("Failed to create pad")
	}
	return &Pad{&Window{p}}, nil
}
Exemplo n.º 2
0
func Newpad(y, x int) (*Window, error) {
	npw, err := C.newpad(C.int(y), C.int(x))
	np := (*Window)(npw)
	if err != nil && np == nil {
		return nil, CursesError{fmt.Sprintf("newpad failed: %v", err)}
	}
	return np, nil
}
Exemplo n.º 3
0
// Create new pad.
func NewPad(nlines int, ncols int) *Window {
	w := new(Window)
	w.cwin = C.newpad(C.int(nlines), C.int(ncols))
	return w
}