Example #1
0
func (win *Window) Subwin(rows, cols, starty, startx int) (*Window, error) {
	sw := (*Window)(C.subwin((*C.WINDOW)(win), C.int(rows), C.int(cols), C.int(starty), C.int(startx)))
	if sw == nil {
		return nil, CursesError{"subwin failed"}
	}
	return sw, nil
}
Example #2
0
func (win *Window) SubWindow(rows int, columns int, startY int, startX int) (*Window, error) {
	window := (*Window)(C.subwin((*C.WINDOW)(win), C.int(rows), C.int(columns), C.int(startY), C.int(startX)))

	if window == nil {
		return nil, CursesError{"Failed to create window"}
	}

	return window, nil
}
Example #3
0
func (win *Window) Subwin(rows int, cols int, starty int, startx int) (*Window, os.Error) {
	sw := (*Window)(C.subwin((*C.WINDOW)(win), C.int(rows), C.int(cols), C.int(starty), C.int(startx)))

	if sw == nil {
		return nil, CursesError{"Failed to create window"}
	}

	return sw, nil
}
Example #4
0
//Flakey function according to ncurses DOC
func (w *Window) SubWindow(rows, cols, starty, startx int) (*Window, error) {
	sw := C.subwin(w.win, C.int(rows), C.int(cols), C.int(starty), C.int(startx))

	if sw == nil {
		return nil, ErrorWindowCreation
	}

	return &Window{sw}, nil
}
Example #5
0
// SubWindow creates a new window of height and width at the coordinates
// y, x.  This window shares memory with the original window so changes
// made to one window are reflected in the other. It is necessary to call
// Touch() on this window prior to calling Refresh in order for it to be
// displayed.
func (w *Window) Sub(height, width, y, x int) *Window {
	return &Window{C.subwin(w.win, C.int(height), C.int(width), C.int(y),
		C.int(x))}
}