README added; main_loop example added.
This commit is contained in:
parent
acfa130e92
commit
08abd67519
1
vala/live.gnome.org_tutorial/README
Normal file
1
vala/live.gnome.org_tutorial/README
Normal file
@ -0,0 +1 @@
|
|||||||
|
First look at https://live.gnome.org/Vala/Examples
|
16
vala/live.gnome.org_tutorial/main_loop.vala
Normal file
16
vala/live.gnome.org_tutorial/main_loop.vala
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
|
|
@ -6,3 +6,5 @@ valac --thread philosophers.vala
|
|||||||
valac --thread async-queue-test.vala
|
valac --thread async-queue-test.vala
|
||||||
|
|
||||||
valac --pkg gio-2.0 dbus-demo-service.vala
|
valac --pkg gio-2.0 dbus-demo-service.vala
|
||||||
|
|
||||||
|
valac main_loop.vala
|
||||||
|
Loading…
x
Reference in New Issue
Block a user