Replace deprecated GTK+ API calls by non-deprecated API
Fix compiler warnings and deprecations in tests