From 0fa0305aaeec6b94274a0f7f94f52cf407ac2575 Mon Sep 17 00:00:00 2001 From: Milo Gilad Date: Sat, 26 Aug 2017 11:25:20 -0400 Subject: Added main loop section and collections library/multithreading info --- vala.html.markdown | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/vala.html.markdown b/vala.html.markdown index 93ae6abd..5ff3486c 100755 --- a/vala.html.markdown +++ b/vala.html.markdown @@ -455,8 +455,30 @@ void error_demo2() { } } +// Main Loop + +void main() { + + var main_loop = new MainLoop(); + var time = new TimeoutSource(2000); + + time.set_callback(() => { // Executes the following lambda after 2000ms + stdout.printf("2000ms have passed\n"); + main_loop.quit(); + return false; + }); + + time.attach(main_loop.get_context()); + + loop.run(); +} + +// Pointers + ``` * More Vala documentation can be found [here](https://valadoc.org/). * [Alternate construction syntax](https://wiki.gnome.org/Projects/Vala/Tutorial#GObject-Style_Construction) similar to GObject * More on contract programming [here](http://en.wikipedia.org/wiki/Contract_programming) +* Collections library can be found [here](https://wiki.gnome.org/Projects/Vala/Tutorial#Collections) +* [Multithreading](https://wiki.gnome.org/Projects/Vala/Tutorial#Multi-Threading) * Read about building GUIs with GTK+ and Vala [here](http://archive.is/7C7bw). -- cgit v1.2.3