diff options
Diffstat (limited to 'gauss_cv.c')
-rw-r--r-- | gauss_cv.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1,5 +1,6 @@ #include <string.h> #include <gtk/gtk.h> +#include <glib.h> #include <cv.h> #include <highgui.h> @@ -208,14 +209,20 @@ main(int argc, char *argv[]) struct cvg cvg; GtkBuilder *builder; GObject *file_chooser; + gchar *path, *file; memset(&cvg, 0, sizeof cvg); gtk_init(&argc, &argv); if (argc >= 2) open_file(&cvg, argv[argc-1]); + builder = gtk_builder_new(); - gtk_builder_add_from_file(builder, "gauss_cv.ui", NULL); + path = g_path_get_dirname(argv[0]); + file = g_build_filename(path, "gauss_cv.ui", NULL); + gtk_builder_add_from_file(builder, file, NULL); + g_free(path); + g_free(file); gtk_builder_connect_signals(builder, &cvg); cvg.drawing_area1 = GTK_WIDGET(gtk_builder_get_object(builder, |