예제 #1
0
파일: window.go 프로젝트: zyxar/gocurse
func (win *Window) Derwin(rows int, cols int, starty int, startx int) (*Window, error) {
	dw := (*Window)(C.derwin((*C.WINDOW)(win), C.int(rows), C.int(cols), C.int(starty), C.int(startx)))
	if dw == nil {
		return nil, CursesError{"derwin failed"}
	}
	return dw, nil
}
예제 #2
0
파일: curses.go 프로젝트: jncorpron/gocurse
func (win *Window) DerivedWindow(rows int, columns int, startY int, startX int) (*Window, error) {
	window := (*Window)(C.derwin((*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
}
예제 #3
0
파일: curses.go 프로젝트: zozor/gocurse
//Flakey function according to ncurses DOC
func (w *Window) Derwin(rows, cols, starty, startx int) (*Window, error) {
	dw := C.derwin(w.win, C.int(rows), C.int(cols), C.int(starty), C.int(startx))

	if dw == nil {
		return nil, ErrorWindowCreation
	}

	return &Window{dw}, nil
}
예제 #4
0
func (win *Window) Derwin(cols int, rows int, startx int, starty int) (*Window, os.Error) {
	in()
	defer out()
	dw := (*Window)(C.derwin((*C.WINDOW)(win), C.int(rows), C.int(cols), C.int(starty), C.int(startx)))

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

	return dw, nil
}
예제 #5
0
// Derived creates a new window of height and width at the coordinates
// y, x.  These coordinates are relative to the original window thereby
// confining the derived window to the area of original window. See the
// SubWindow function for additional notes.
func (w *Window) Derived(height, width, y, x int) *Window {
	return &Window{C.derwin(w.win, C.int(height), C.int(width), C.int(y),
		C.int(x))}
}
예제 #6
0
파일: ncurses.go 프로젝트: Olreich/ncurses
/* Creates a new window, based on the origin Window (nc.Init returns stdscr, so this should be used for other window). The startx and starty variables begin in the upper-left corner and increase going down and to the right of the screen. These are also relative to the origin window. */
func NewWindow(origin *Window, height, width, startx, starty int) *Window {
	origin.Touch()
	return (*Window)(C.derwin((*C.WINDOW)(origin), C.int(height), C.int(width), C.int(starty), C.int(startx)))
}