Problems with gtk_item_factory_popup()



Does anyone know what I am doing wrong when get the following error
message:

GtkCRITICAL **: file gtkitemfactory.c: line 1384
(Gtk_item_factory_popup_with_data):
assertion 'GTK_IS_MENU (ifactory->widget)' failed.

The code that generates this error message:

GtkItemFactory *factory;
GtkMenuPath *menu_path;

static GtkItemFactoryEntry mbox_popup_items[] =
{
  { "/Properties", NULL, NULL, 0, "" }
};

static int n_mbox_items = sizeof(mbox_popup_items) /
sizeof(mbox_popup_items[0]);



factory = (GtkItemFactory *) gtk_item_factory_new(GTK_TYPE_MENU_BAR,
                                                            "<Main>",
NULL);
          gtk_item_factory_create_items(GTK_ITEM_FACTORY(factory),
                                        n_mbox_items,
                                        mbox_popup_items,
                                        &mbox);

          gtk_item_factory_popup(GTK_ITEM_FACTORY(factory),
                                 event->x,
                                 event->y,
                                 event->button,
                                 event->time);

Thanks in advance.

-- 

Jonas Almfeldt
jonas.almfeldt@home.se



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]