Class: Newt::CheckboxTreeMulti

Inherits:
CheckboxTree show all
Defined in:
ext/ruby_newt/ruby_newt.c

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CheckboxTree

#add, #find, #get, #get_current, #set, #set_current, #set_entry, #set_width

Methods inherited from Widget

#==, #callback, #get_position, #get_size, #inspect, #takes_focus

Class Method Details

.new(*args) ⇒ Object



1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
# File 'ext/ruby_newt/ruby_newt.c', line 1303

static VALUE rb_ext_CheckboxTreeMulti_new(int argc, VALUE *argv, VALUE self)
{
  newtComponent co;
  char *seq;
  int flags;

  if (argc < 3 || argc > 5)
    ARG_ERROR(argc, "3..5");

  INIT_GUARD();
  seq = NULL;
  if (argc >= 4 && !NIL_P(argv[3]) && RSTRING_LEN(argv[3]))
    seq = StringValuePtr(argv[3]);

  flags = (argc == 5) ? NUM2INT(argv[4]) : 0;

  co = newtCheckboxTreeMulti(NUM2INT(argv[0]), NUM2INT(argv[1]), NUM2INT(argv[2]), seq, flags);
  return Make_Widget(self, co);
}

Instance Method Details

#get_selection(seqnum) ⇒ Object



1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
# File 'ext/ruby_newt/ruby_newt.c', line 1323

static VALUE rb_ext_CheckboxTreeMulti_GetSelection(VALUE self, VALUE seqnum)
{
  newtComponent co;
  VALUE *data;
  int numitems;

  Get_newtComponent(self, co);
  data = (VALUE *) newtCheckboxTreeGetMultiSelection(co, &numitems, StringValuePtr(seqnum)[0]);
  return checkboxtree_collect_selection(numitems, data);
}