Re: [Vala] Allowable to add user data to callback?
- From: bsquared <bwcode4u gmail com>
- Cc: vala-list <vala-list gnome org>
- Subject: Re: [Vala] Allowable to add user data to callback?
- Date: Sat, 20 Aug 2011 16:25:17 -0700
On Sat, Aug 20, 2011 at 3:50 PM, Luca Bruno <lethalman88 gmail com> wrote:
Then you probably want to take a look at the tutorial about lambda
expression:
https://live.gnome.org/Vala/Tutorial#Anonymous_Methods_.2BAC8_Closures
I have looked at that, but it remains a mystery in some part. The
async section was as well before it was redone. I will probably have
to read it several more times and find some concrete examples before
this dim bulb starts to glow.
This is meaningless in Vala without showing the body of the callback.
--
http://www.debian.org - The Universal Operating System
(re-sending due to the fact that gmail sucks for lists)
Thanks.
void pa_state_cb(pa_context *c, void *userdata) {
pa_context_state_t state;
int *pa_ready = userdata;
state = pa_context_get_state(c);
switch (state) {
// There are just here for reference
case PA_CONTEXT_UNCONNECTED:
case PA_CONTEXT_CONNECTING:
case PA_CONTEXT_AUTHORIZING:
case PA_CONTEXT_SETTING_NAME:
default:
break;
case PA_CONTEXT_FAILED:
case PA_CONTEXT_TERMINATED:
*pa_ready = 2;
break;
case PA_CONTEXT_READY:
*pa_ready = 1;
break;
}
}
--
Regards,
-Brian
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]