Re: [Vala] connecting non-gobject callbacks




Le vendredi 28 décembre 2007 à 16:17 +0100, Tilman Sauerbeck a écrit :
Hi,
I'm trying to write a client for XMMS2 in Vala.
XMMS2 doesn't use GObjects, but it uses callbacks in various places,
which makes it hard to use it in Vala.

XMMS2 uses a struct called xmmsc_result_t, to which you can connect a
callback like this:

  static void handler(xmmsc_result_t *res, void *user_data) {...}

  xmmsc_result_t *res;
  xmmsc_result_notifier_set (res, handler, NULL);

So eventually "handler" will be called with res and NULL.

Why didn't you try declaring the callbacks as xmmsc_result_t's methods ?
At first sight it could work.

        Xav





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