コード例 #1
0
ファイル: window.go プロジェクト: zyxar/gocurse
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
}
コード例 #2
0
ファイル: curses.go プロジェクト: jncorpron/gocurse
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
}
コード例 #3
0
ファイル: curses.go プロジェクト: AaronO/lightwave
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
}
コード例 #4
0
ファイル: curses.go プロジェクト: zozor/gocurse
//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
}
コード例 #5
0
ファイル: window.go プロジェクト: trotha01/goncurses
// 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))}
}