#+title: Hello World #+date: <2020-05-10 Sun 15:47> #+created: <2018-08-08 Wed 00:01> #+creator: blog/2018/08/08/hello-world #+setupfile: ../../../../include/blog-post.org #+keywords: org-mode, emacs, hello-world, gtk3, gtk4 #+description: Hello world blog {{{info(Note:, This is a demo page to test the features of this blog. Don’t expect much here.)}}} In the software world, everything begins with ~Hello World~. This is the beginning of my blog. Let’s see how this will go. This page stands to test the features of this blog. This website has been completely designed using GNU Emacs. The static web pages are written in Emacs org-mode and exported to HTML. If you are not yet a [[https://www.gnu.org/software/emacs/][GNU Emacs]] user, give it a try. It’s worth learning. If you are familiar with vim, see [[http://spacemacs.org][Spacemacs]]. You shall feel home. To begin with, let’s see how code blocks in different language be handled. This should be pretty smooth, and cool . * ~Hello World~ How about showing some real content? Have a look at a few examples below. ** C Programming Let’s begin with ~Hello World~ in C Programming. #+include: "../../../../code/c/hello.c" src c Save the above code into ~hello.c~, then compile and run. #+begin_src sh # Compile and run gcc hello.c -o hello && ./hello # An alternate way for the same. If you are # wondering, no, you don't need any Makefile. make hello && ./hello #+end_src ** Emacs lisp Now let’s try this in elisp. The code below will print “Hello World!” to the echo area. To run the program, write the code in GNU Emacs, put the cursor at end of the paren and press {{{key(C-x C-e)}}} . #+begin_src elisp (message "Hello World!") ;; Put the cursor here ^ #+end_src ** GUI using GTK and C :PROPERTIES: :CUSTOM_ID: gtk-c :END: The following example shows a window with a “Hello World!” label. The code will work with GTK3. #+include: "../../../../code/c/hello-gtk3.c" src c The same in GTK4: #+include: "../../../../code/c/hello-gtk4.c" src c The above code is a simple example that works with both GTK3 and GTK4. If you need a feature rich template to develop GTK applications, see [[https://www.sadiqpk.org/projects/my-gtemplate.html][My GTemplate]] project.