Method: Curses::Pad#subpad

Defined in:
ext/curses/curses.c

#subpad(height, width, begin_x, begin_y) ⇒ Object

Construct a new subpad with constraints of height lines, width columns, begin at begin_x line, and begin_y columns on the pad.



3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
# File 'ext/curses/curses.c', line 3122

static VALUE
pad_subpad(VALUE obj, VALUE height, VALUE width, VALUE begin_x, VALUE begin_y)
{
    struct windata *padp;
    WINDOW *sub_pad;
    VALUE pad;
    int h, w, x, y;

    h = NUM2INT(height);
    w = NUM2INT(width);
    x = NUM2INT(begin_x);
    y = NUM2INT(begin_y);
    GetWINDOW(obj, padp);
    sub_pad = subpad(padp->window, h, w, x, y);
    pad = prep_window(rb_obj_class(obj), sub_pad, 0);

    return pad;
}