Re: [Vala] problem using sleep
- From: Frederik <scumm_fredo gmx net>
- To: vala-list <vala-list gnome org>
- Subject: Re: [Vala] problem using sleep
- Date: Sat, 10 Oct 2009 19:49:32 +0200
a a wrote:
I want to stop the timeout by pressing a button.
What code stopes it?
Thanks.
int time_min = 5;
var timeout = Timeout.add (time_min * 1000 * 60, () => {
try {
Process.spawn_command_line_async ("gksudo '/etc/acpi/hibernate.sh'");
} catch (Error e) {
stderr.printf ("%s\n", e.message);
}
return false;
});
var button = new Button.with_label ("Stop!");
button.clicked.connect (() => Source.remove (timeout));
Best regards,
Frederik
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]