{"id":1647,"date":"2013-01-19T00:19:41","date_gmt":"2013-01-18T20:19:41","guid":{"rendered":"http:\/\/sandalov.org\/blog\/?p=1647"},"modified":"2013-12-12T15:20:51","modified_gmt":"2013-12-12T11:20:51","slug":"vala-0-18-1-hello-world-in-ubuntu-12-10","status":"publish","type":"post","link":"https:\/\/sandalov.org\/blog\/1647\/","title":{"rendered":"Vala 0.18.1 hello world in Ubuntu 12.10"},"content":{"rendered":"<div class=\"2d836d85a73757df15d0de19d7bef594\" data-index=\"1\" style=\"float: none; margin:10px 0 10px 0; text-align:center;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-2287684400845931\";\r\n\/* valerymorozov *\/\r\ngoogle_ad_slot = \"5606708872\";\r\ngoogle_ad_width = 728;\r\ngoogle_ad_height = 90;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n<p>After this tutorial you&#8217;ll learn how to compile your first vala GTK program<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sandalov.org\/blog\/wp-content\/uploads\/2013\/01\/Screenshot-from-2013-01-19-002205.png\" alt=\"Screenshot from 2013-01-19 00:22:05\" width=\"352\" height=\"99\" class=\"aligncenter size-full wp-image-1652\" srcset=\"https:\/\/sandalov.org\/blog\/wp-content\/uploads\/2013\/01\/Screenshot-from-2013-01-19-002205.png 352w, https:\/\/sandalov.org\/blog\/wp-content\/uploads\/2013\/01\/Screenshot-from-2013-01-19-002205-300x84.png 300w, https:\/\/sandalov.org\/blog\/wp-content\/uploads\/2013\/01\/Screenshot-from-2013-01-19-002205-250x70.png 250w\" sizes=\"auto, (max-width: 352px) 100vw, 352px\" \/><\/p>\n<p>Prepare your system:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# add the GPG key for the vala team PPA\r\nsudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 7DAAC99C\r\n# add the PPA to your Software Sources\r\nsudo add-apt-repository ppa:vala-team\r\n# update the package lists\r\nsudo apt-get update\r\n# install vala\r\nsudo apt-get install valac-0.18 vala-0.18-doc valac-0.18-dbg\r\nvalac --version\r\n\r\n# optionally install other PPA packages\r\n# libgee - collections library\r\nsudo apt-get install libgee-dev \r\n\r\n# install gtk-dev\r\nsudo apt-get install libgtk-3-dev\r\n<\/pre>\n<p>Save program text to <em>hello.vala<\/em> file:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nusing Gtk;\r\n \r\nint main (string&#x5B;] args) {\r\n    Gtk.init(ref args);\r\n \r\n    var window = new Window();\r\n    window.title = &quot;Hello, World!&quot;;\r\n    window.border_width = 10;\r\n    window.window_position = WindowPosition.CENTER;\r\n    window.set_default_size(350, 70);\r\n    window.destroy.connect(Gtk.main_quit);\r\n \r\n    var label = new Label(&quot;Hello, World!&quot;);\r\n \r\n    window.add(label);\r\n    window.show_all();\r\n \r\n    Gtk.main();\r\n    return 0;\r\n}\r\n<\/pre>\n<p>Compile and launch the prog:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nvalac --pkg gtk+-3.0 hello.vala &amp;&amp; .\/hello\r\n<\/pre>\n<div class=\"2d836d85a73757df15d0de19d7bef594\" data-index=\"1\" style=\"float: none; margin:10px 0 10px 0; text-align:center;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-2287684400845931\";\r\n\/* valerymorozov *\/\r\ngoogle_ad_slot = \"5606708872\";\r\ngoogle_ad_width = 728;\r\ngoogle_ad_height = 90;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>After this tutorial you&#8217;ll learn how to compile your first vala GTK program Prepare your system: # add the GPG key for the vala team PPA sudo apt-key adv &#8211;recv-keys &#8211;keyserver keyserver.ubuntu.com 7DAAC99C # add the PPA to your Software Sources sudo add-apt-repository ppa:vala-team # update the package lists sudo &hellip; <a class=\"continue-reading-link\" href=\"https:\/\/sandalov.org\/blog\/1647\/\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[315,52],"tags":[379,316],"class_list":["post-1647","post","type-post","status-publish","format-standard","hentry","category-development","category-ubuntu","tag-ubuntu","tag-vala"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/1647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/comments?post=1647"}],"version-history":[{"count":6,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/1647\/revisions"}],"predecessor-version":[{"id":1906,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/1647\/revisions\/1906"}],"wp:attachment":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/media?parent=1647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/categories?post=1647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/tags?post=1647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}