Esempio n. 1
0
static VALUE
ifact_construct(int argc, VALUE *argv, VALUE self)
{
    VALUE type, path, accel;
    GtkItemFactory* ifact = _SELF(self);
    ifact->accel_group = NULL;

    rb_scan_args(argc, argv, "21", &type, &path, &accel);
    gtk_item_factory_construct(ifact, FIX2INT(type), 
                               RVAL2CSTR(path), RVAL2ACCEL(accel));
    return self;
}
Esempio n. 2
0
/******************************************************************************
* gtk_ItemFactoryConstruct( itemFactory, container_type, spath, accel_group ) --> NIL
* container_type is  one of :GTK_TYPE_MENU_BAR, GTK_TYPE_MENU or GTK_TYPE_OPTION_MENU
******************************************************************************/
int
clip_GTK_ITEMFACTORYCONSTRUCT(ClipMachine * cm)
{
        C_object       *citem = _fetch_co_arg(cm);
        GtkType		 type = INT_OPTION(cm, 2, GTK_TYPE_MENU_BAR);
        const gchar     *path = _clip_parc(cm, 3);
        C_object      *caccel = _fetch_cobject(cm, _clip_spar(cm, 4));

	CHECKARG(1, MAP_t); CHECKCOBJ(citem, GTK_IS_ITEM_FACTORY(citem->object));
	CHECKARG(2, NUMERIC_t);
	CHECKARG(3, CHARACTER_t);
	CHECKOPT(4, MAP_t); CHECKCOBJOPT(caccel, GTK_IS_ACCEL_GROUP(caccel->object));

	gtk_item_factory_construct(GTK_ITEM_FACTORY(citem->object), type,
		path, GTK_ACCEL_GROUP(caccel->object));

	return 0;
err:
	return 1;
}