Creating the main window for the application
GtkApplication initializes GTK+. It also connects the x button that's automatically generated along with the window to the "destroy" signal.
We can start building our first window. We do this by creating a variable called _window and assigning it a new Gtk.ApplicationWindow.
We give the window a property called title. The title can be any string you want it to be. To be on the safe side, it's best to stick to UTF-8 encoding.
Now we have a window which has a title and a working "close" button. Let's add the actual "Hello World" text.
Label for the window
A text label is one of the GTK+ widgets we can use, on account of having imported the GTK+ library. To use it, we create a new variable called label, and assign it a new Gtk.Label. Then we give it properties inside the curly braces {}. In this case, we're setting the text that the label will hold. Finally, we create and run the application:
Gtk.ApplicationWindow can only hold one widget at a time. To construct more elaborate programs you need to create a holder widget like Gtk.Grid inside the window, and then add all the other widgets to it.