add check to make sure resource exists

This commit is contained in:
Chris Cromer 2018-09-24 16:17:47 -03:00
parent 23051f4a8c
commit a1225763d6
Signed by: cromer
GPG Key ID: 39CC813FF3C8708A

View File

@ -8,7 +8,7 @@
#define _(STRING) gettext(STRING)
#define TAX 1.111111111
#define VERSION "1.0.0"
#define VERSION "1.0.1"
GtkLabel *calculated_value = NULL;
@ -71,11 +71,16 @@ int main(int argc, char *argv[]) {
GtkBuilder *builder;
GtkWidget *window;
GError *error = NULL;
gtk_init(&argc, &argv);
builder = gtk_builder_new();
gtk_builder_add_from_resource(builder, "/cl/cromer/addtax/window_main.glade", NULL);
gtk_builder_add_from_resource(builder, "/cl/cromer/addtax/window_main.glade", &error);
if (error != NULL) {
fprintf(stderr, "Error: %s\n", error->message);
return 1;
}
window = GTK_WIDGET(gtk_builder_get_object(builder, "window_main"));
gtk_builder_connect_signals(builder, NULL);