GtkItemFactoryEntry



It is rather a C problem but it is related to Gtk though :

I have this code in my menu.h file:

static GtkItemFactoryEntry menu_items[] = {
  { "/_File",         NULL,         NULL, 0, "<Branch>" },
  { "/File/Quit",     "<control>Q", application_quit, application, NULL
},
  { "/_Options",      NULL,         NULL, 0, "<Branch>" },
  { "/Options/Test..",  NULL,         NULL, 0, NULL },
  { "/_Help",         NULL,         NULL, 0, "<LastBranch>" },
  { "/_Help/About",   NULL,         NULL, 0, NULL },
};

I want to connect the "Quit" menu item to the "application_quit"
callback, which takes a "GtkWidget *" as argument. The problem is :
"application_quit" is declared in exit.h and "application" (which is a
GtkWidget * thus) is declared in main.c. When i try to compile that
stuff, the compiler says :

 In file included from menu.c:23:
menu.h:27: `application_quit' undeclared here (not in a function)
menu.h:27: initializer element is not constant
menu.h:27: (near initialization for `menu_items[1].callback')
menu.h:27: `application' undeclared here (not in a function)
menu.h:27: initializer element is not constant
menu.h:27: (near initialization for `menu_items[1].callback_action')
make: *** [menu.o] Error 1

How can i make all this stuff working ?

Thanks for your answers...

--
Regards
Dusausoy Bruno







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