GTK+ By Example/GTK+/Hello World

This small tutorial demonstrates creating a simple window with a single button. When the button is clicked, the contents of that label on the button is printed to stdout.

The label is packed into the button, which is in turn packed into the window.

Firstly, you must include the gtk header file.

Next, two callback functions prototypes are defined, one for closing the window, and one for clicking on the button. Callback functions are basically functions that are called by lower-level code (in this case, GTK itself) by being passed the function address.