Problem with g++ and GtkItemFactory functions



Hi folks,

I've got some functions:

void create_save_perl_fs (signal_object *s_obj) {};
void create_save_as_perl_fs (signal_object *s_obj) {};
void create_new_perl_fs (signal_object *s_obj) {};

and a GtkItemFactoryEntry setup as follows:

   GtkItemFactoryEntry perl_file_select_menu[] = {
     { "/Open", NULL, create_open_perl_fs, 0, NULL },
     { "/Save", NULL, create_save_perl_fs, 0, NULL },
     { "/Save As", NULL, create_save_as_perl_fs, 0, NULL }
   };

I even try to pass the data correctly via:

   gtk_item_factory_create_items (item_factory, nmenu_items,
perl_file_select_menu, (signal_object *)s_obj);
But my g++ complains:

perl_buffer_obj.C: In function `GtkWidget* setup_perl_fs_menu(signal_object*)': perl_buffer_obj.C:58: invalid conversion from `void (*)(signal_object*)' to `
  void (*)()'
perl_buffer_obj.C:58: invalid conversion from `void (*)(signal_object*)' to `
  void (*)()'
perl_buffer_obj.C:58: invalid conversion from `void (*)(signal_object*)' to `
  void (*)()'
perl_buffer_obj.C:58: invalid conversion from `void (*)(signal_object*)' to `
  void (*)()'
make: *** [perl_buffer_obj.o] Error 1

Sadly, I use the exact same technique with regular gcc (for non C++ sections of my code) with no problem.

Does anyone have a workaround or some kind o macro to fix this?

Thanks,

DT

--
Technical Director - Virginia Center for Computer Music
http://www.virginia.edu/music/vccm.html






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