Re: g_cclosure_marshal and enum parameter



nicola fragale wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I have a problem with a signal I'm trying to implement. My signal has 2
parameter, the second is an enum.
This is the code

~  rubrica_cards_view_signals[MARK] =
~    g_signal_new("mark",
~         RUBRICA_CARDS_VIEW_TYPE,
~         G_SIGNAL_RUN_LAST,
~         G_STRUCT_OFFSET(RubricaCardsViewClass, mark),
~         NULL,
~         NULL,
~         g_cclosure_user_marshal_VOID__LONG_ENUM,
~         G_TYPE_NONE,
~         2,
~         G_TYPE_LONG,
~         G_TYPE_ENUM);

when I run my program I receve this warnig
GLib-GObject-WARNING **: gsignal.c:1270: parameter 2 of type `GEnum' for
signal "RubricaCardsView::mark" is not a value type

I tryed to change enum with int, but callback function doesn't receive
the second value, just the first.
I read man pages and see that I shoul use glib-mkenums, but I can't
figure how. Can someone explains the steps I have to do or point me to a
solutions?

You need to provide the GEnum type you want to use as and argument, for example RUBRICA_TYPE_MARK. This obviously require you to register GTypes for
all the enums you want to use as signal arguments.

Johan



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