I’m trying to create an array structure of GtkItemFactoryEntry it looks like the following
static GtkItemFactoryEntry menu_items[] =
{
{"/_File", "<control>f", NULL, 0, "<Branch>"},
{"/File/sep1", NULL, NULL, 0, "<Separator>"},
{"/File/Quit", "<control>q", myQuit, 0, NULL},
{"/_Level", NULL, NULL, 0, "<Branch>"},
{"/Level/_Up", "<control>p", handle_level_up, 0, NULL},
{"/Level/_Down", "<control>d", handl_level_down, 0, NULL},
{"/_Update", NULL, NULL, 0, "<Branch>"},
{"/Update/_Date", NULL, handle_update_date, 0, NULL},
{"/Update/_All", "<control>u", handle_update, 0, NULL},
{"/_Filter", "<control>l", handle_filter, 0, "<Branch>"},
{"/_Export", "<control>e", handle_export, 0, "<Branch>"},
{"/_Mode", "<control>m", NULL, 0, "<LastBranch>"},
{"/Mode/_Graph", "<control>g", handle_switch, NULL},
{"/Mode/_Table", "<control>t", handle_switch, NULL},
{"/Mode/_TSeries", "<control>s", handle_switch, NULL},
};
with the callback functions declared as
func (gpointer data, guint notused, GtkWidget* w);
however I get the msg
Cannot use void(*)(gpointer,unsigned,_GtkWidget*) to initialize extern "C" void(*)()
i noticed GtkItemFactoryEntry is declared as
struct GtkItemFactoryEntry
{
gchar *path;
gchar *accelerator;
GtkItemFactoryCallback callback;
guint callback_action;
gchar *item_type;
};
with GtkItemFactoryCallback being void(*)
but in the documentation, it says
gtk_item_factory_create_items () takes an array of GtkItemFactoryEntrys whose callback members must by of type GtkItemFactoryCallback1
am I missing something, how does gtk_item_factory_create_items require the func to be of a different type than is declared in the GtkItemFactoryEntry structure?
Thank you,
john