static VALUE rb_ext_Form_new(VALUE self, VALUE left, VALUE top, VALUE text) { newtComponent co; co = newtForm(NULL, NULL, 0); return Data_Wrap_Struct(self, 0, 0, co); //return Data_Wrap_Struct(self, 0, rb_ext_Form_Destroy, co); }
static VALUE rb_ext_Form_AddComponents(VALUE self, VALUE co) { int i; newtComponent form, cco; Data_Get_Struct(self, struct newtComponent_struct, form); for (i = 0; i < RARRAY_LEN(co); i++) { Data_Get_Struct(RARRAY_PTR(co)[i], struct newtComponent_struct, cco); newtFormAddComponent(form, cco); } return Qnil; }
static VALUE rb_ext_Form_AddComponent(VALUE self, VALUE co) { newtComponent form, cco; Data_Get_Struct(self, struct newtComponent_struct, form); Data_Get_Struct(co, struct newtComponent_struct, cco); newtFormAddComponent(form, cco); return Qnil; }
static VALUE rb_ext_Form_AddHotKey(VALUE self, VALUE key) { newtComponent form; Data_Get_Struct(self, struct newtComponent_struct, form); newtFormAddHotKey(form, NUM2INT(key)); return Qnil; }
static VALUE rb_ext_Form_DrawForm(VALUE self) { newtComponent form; Data_Get_Struct(self, struct newtComponent_struct, form); newtDrawForm(form); return Qnil; }
static VALUE rb_ext_Run_Form(VALUE self) { newtComponent form, co; Data_Get_Struct(self, struct newtComponent_struct, form); co = newtRunForm(form); return Data_Wrap_Struct(cWidget, 0, 0, co); }
static VALUE rb_ext_Form_SetBackground(VALUE self, VALUE color) { newtComponent form; Data_Get_Struct(self, struct newtComponent_struct, form); newtFormSetBackground(form, NUM2INT(color)); return Qnil; }
static VALUE rb_ext_Form_SetHeight(VALUE self, VALUE height) { newtComponent form; Data_Get_Struct(self, struct newtComponent_struct, form); newtFormSetHeight(form, NUM2INT(height)); return Qnil; }
static VALUE rb_ext_Form_SetWidth(VALUE self, VALUE width) { newtComponent form; Data_Get_Struct(self, struct newtComponent_struct, form); newtFormSetWidth(form, NUM2INT(width)); return Qnil; }