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

20 lines
363 B
Vala
Raw Normal View History

2013-03-28 18:45:57 +04:00
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());
2014-11-07 19:24:20 +03:00
stdout.puts ("Call MainLoop.run ():\n");
loop.run(); // blocking method
2013-03-28 18:45:57 +04:00
2014-11-07 19:24:20 +03:00
stdout.puts ("End of main().\n");
}