Method: Curses::Menu#items

Defined in:
ext/curses/curses.c

#itemsObject

call-seq:

items

Returns the items of the menu.



3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
# File 'ext/curses/curses.c', line 3456

static VALUE
menu_get_items(VALUE obj)
{
    struct menudata *menup;
    ITEM **items;
    int count, i;
    VALUE ary;

    GetMENU(obj, menup);
    items = menu_items(menup->menu);
    if (items == NULL) {
  return Qnil;
    }
    count = item_count(menup->menu);
    ary = rb_ary_new();
    for (i = 0; i < count; i++) {
  rb_ary_push(ary, item_new(items[i]));
    }
    return ary;
}