Re: [Vala] Run signal once



It's good, not a workaround.


On Mon, Nov 12, 2012 at 3:02 AM, Ivo Kosir <ivokosir yahoo com> wrote:

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!

_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list




-- 
www.debian.org - The Universal Operating System


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