Re: GtkItemFactoryEntry
- From: Brett Nash <nash nash nu>
- To: Dusausoy Bruno <bruno dusausoy skynet be>
- Cc: Gtk Mailing-List <gtk-app-devel-list gnome org>
- Subject: Re: GtkItemFactoryEntry
- Date: Sun, 11 Aug 2002 11:10:32 +1000
It is rather a C problem but it is related to Gtk though :
It is a C feature (well known problem ;-)
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')
You have a few choices:
The first is menu.c should also include main.h (with
declerations or application_quit and application) before menu.h. This
means however declerartions of things such as menu_items must be placed
in menu.c.
Alternatively you can have menu.h include main.h - careful
however, including headers from headers can be dangerous.
Finally you can prototype application_quit and application in
menu.h before the array:
void application_quit(its args here);
extern struct application_type application;
This will work nicely, but it well quickly become hard to maintain.
I would recommend you move menu_items into menu.c and have the
headers for prototypes only.
Regards,
nash
--
Brett Nash <nash nash nu>
Sometimes it's better to light a flamethrower than curse the darkness.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]