Главный цикл(The Main Loop)
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());
loop.run();
}void main(string[] args) {
Gtk.init(ref args);
var time = new TimeoutSource(2000);
time.set_callback(() => {
stdout.printf("Время!\n");
Gtk.main_quit();
return false;
});
time.attach(null);
Gtk.main();
}Last updated
Was this helpful?