dev/vala/live.gnome.org_tutorial/main_loop.vala

20 lines
363 B
Vala

void main() {
var loop = new MainLoop();
var time = new TimeoutSource(2000);
time.set_callback(() => {
stdout.printf("Time!\n");
loop.quit();
return false;
});
time.attach(loop.get_context());
stdout.puts ("Call MainLoop.run ():\n");
loop.run(); // blocking method
stdout.puts ("End of main().\n");
}