コード例 #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
ファイル: curses.go プロジェクト: serraavenger/gocurses
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
ファイル: window.go プロジェクト: trotha01/goncurses
// 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)))
}