Gtk training from zetcode, with modification for Gtk 3 compatibility