Method: Curses::Window#derwin

Defined in:
ext/curses/curses.c

#derwin(height, width, relative_top, relative_left) ⇒ Object

Construct a new subwindow with constraints of height lines, width columns, begin at top line, and begin left most column relative to the parent window.



1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
# File 'ext/curses/curses.c', line 1883

static VALUE
window_derwin(VALUE obj, VALUE height, VALUE width, VALUE top, VALUE left)
{
    struct windata *winp;
    WINDOW *window;
    VALUE win;
    int h, w, t, l;

    h = NUM2INT(height);
    w = NUM2INT(width);
    t = NUM2INT(top);
    l = NUM2INT(left);
    GetWINDOW(obj, winp);
    window = derwin(winp->window, h, w, t, l);
    win = prep_window(rb_obj_class(obj), window, 0);

    return win;
}