Re: Problem with g++ and GtkItemFactory functions



Hi,

David Topper <topper virginia edu> writes:

> Thanks for the quick reply ... but it doesn't really provide me with a
> solution as far as I can tell:
> 
> Sven Neumann wrote:
> 
> >there's a comment in the gtkitemgactory.h header file that explains
> >your problem:
> >
> > /* We use () here to mean unspecified arguments. This is deprecated
> >  * as of C99, but we can't change it without breaking compatibility.
> >  * (Note that if we are included from a C++ program () will mean
> >  * (void) so an explicit cast will be needed.)
> >  */

it says, "an explicit cast will be needed", so you will have to cast
the function pointers to (GtkItemFactoryCallback) when you setup your
array:

    GtkItemFactoryEntry perl_file_select_menu[] = {
      { "/Open", NULL, (GtkItemFactoryCallback) create_open_perl_fs, 0, NULL },
      ...


Sven




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