summaryrefslogtreecommitdiff
path: root/demos/gtk-demo/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/gtk-demo/main.c')
-rw-r--r--demos/gtk-demo/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index 56a094ecae..417dbf66c4 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -88,6 +88,19 @@ load_file (const gchar *filename)
gtk_text_buffer_delete (source_buffer, &start, &end);
file = fopen (filename, "r");
+
+ if (!file)
+ {
+ char *installed = g_strconcat (DEMOCODEDIR,
+ G_DIR_SEPARATOR_S,
+ filename,
+ NULL);
+
+ file = fopen (installed, "r");
+
+ g_free (installed);
+ }
+
if (!file)
{
g_warning ("Cannot open %s: %s\n", filename, g_strerror (errno));