class Curses::Item
Public Class Methods
Source
static VALUE item_initialize(VALUE obj, VALUE name, VALUE description) { struct itemdata *itemp; curses_init_screen(Qnil); TypedData_Get_Struct(obj, struct itemdata, &itemdata_type, itemp); if (itemp->item) { rb_raise(rb_eRuntimeError, "already initialized item"); } name = rb_str_export_to_enc(name, terminal_encoding); description = rb_str_export_to_enc(description, terminal_encoding); itemp->item = new_item(StringValueCStr(name), StringValueCStr(description)); if (itemp->item == NULL) { check_curses_error(errno); } return obj; }
Construct a new Curses::Item
.
Public Instance Methods
Source
static VALUE item_eq(VALUE obj, VALUE other) { struct itemdata *item1, *item2; GetITEM(obj, item1); GetITEM(other, item2); return item1->item == item2->item ? Qtrue : Qfalse; }
Source
static VALUE item_description_m(VALUE obj) { struct itemdata *itemp; const char *desc; GetITEM(obj, itemp); desc = item_description(itemp->item); return rb_external_str_new_with_enc(desc, strlen(desc), terminal_encoding); }
Source
static VALUE item_name_m(VALUE obj) { struct itemdata *itemp; const char *name; GetITEM(obj, itemp); name = item_name(itemp->item); return rb_external_str_new_with_enc(name, strlen(name), terminal_encoding); }
Source
static VALUE item_opts_m(VALUE obj) { struct itemdata *itemp; GetITEM(obj, itemp); return INT2NUM(item_opts(itemp->item)); }
Get the current option bits of the item.
Source
static VALUE item_opts_off_m(VALUE obj, VALUE opts) { struct itemdata *itemp; int error; GetITEM(obj, itemp); error = item_opts_off(itemp->item, NUM2INT(opts)); check_curses_error(error); return obj; }
Turn off the option bits of the item.
Source
static VALUE item_opts_on_m(VALUE obj, VALUE opts) { struct itemdata *itemp; int error; GetITEM(obj, itemp); error = item_opts_on(itemp->item, NUM2INT(opts)); check_curses_error(error); return obj; }
Turn on the option bits of the item.
Source
static VALUE item_set_opts(VALUE obj, VALUE opts) { struct itemdata *itemp; int error; GetITEM(obj, itemp); error = set_item_opts(itemp->item, NUM2INT(opts)); check_curses_error(error); return obj; }
Set the option bits of the item.