diff options
author | Milo Gilad <milogaccnts@gmail.com> | 2017-08-26 11:25:20 -0400 |
---|---|---|
committer | Milo Gilad <milogaccnts@gmail.com> | 2017-08-26 11:25:20 -0400 |
commit | 0fa0305aaeec6b94274a0f7f94f52cf407ac2575 (patch) | |
tree | 1178a3e5ba5ec1933453179dcd5fde5f15ddbc54 | |
parent | 374ce84fe9f672b49192ddff2f86d5e3f98d8491 (diff) |
Added main loop section and collections library/multithreading info
-rwxr-xr-x | vala.html.markdown | 22 |
1 files changed, 22 insertions, 0 deletions
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). |