summaryrefslogtreecommitdiff
path: root/gauss_cv.c
diff options
context:
space:
mode:
Diffstat (limited to 'gauss_cv.c')
-rw-r--r--gauss_cv.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gauss_cv.c b/gauss_cv.c
index da832ae..2f994b9 100644
--- a/gauss_cv.c
+++ b/gauss_cv.c
@@ -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,