summaryrefslogtreecommitdiff
path: root/x11/xcurs/files/patch-gladew.py
blob: fa2241d7bc5ed45a6be6dd152b9101f06b0cfdc8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- gladew.py.orig	Mon Dec 27 11:44:55 2004
+++ gladew.py	Mon Dec 27 11:44:39 2004
@@ -2,7 +2,11 @@
 pygtk.require('2.0')
 import gtk.glade
 import gobject
-import new, types
+import os, sys, new, types
+
+def find_datafile(filename):
+    prefix = os.path.split(os.path.dirname(sys.argv[0]))[0]
+    return os.path.join(prefix, 'share', 'xcurs', filename)
 
 class GladeWidget:
     #if we are doing instance counting, this holds the variable
@@ -13,7 +17,7 @@
 
         #initialize variables
         self.autoclose = autoclose
-        self.widgets = gtk.glade.XML(glade_file, widget_name)
+        self.widgets = gtk.glade.XML(find_datafile(glade_file), widget_name)
         callbacks = {}
 
         #find and store methods as bound callbacks