Updated code for Gtk3 and GObject