[Vala] Run signal once
- From: Ivo Kosir <ivokosir yahoo com>
- To: "vala-list gnome org" <vala-list gnome org>
- Subject: [Vala] Run signal once
- Date: Sun, 11 Nov 2012 18:02:42 -0800 (PST)
Hi,
While programming with signals it happened many times that I wanted to connect signal, but run it only once.
So, I was doing it like this:
ulong id = 0;
id = object.signal.connect(() => {
do_something();
object.disconnect(id);
});
This looks a bit complicated, and more like a workaround, not a real solution.
Is this a good solution, or I'm missing something?
Thanks!
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]