Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa71abc

Browse files
author
pkienzle
committed
locate xrc file relative to script
svn path=/trunk/matplotlib/; revision=5841
1 parent 88b95e2 commit fa71abc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

examples/user_interfaces/embedding_in_wx3.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ def onEraseBackground(self, evt):
9696

9797
class MyApp(App):
9898
def OnInit(self):
99-
self.res = XmlResource("data/embedding_in_wx3.xrc")
99+
xrcfile = os.path.join(os.path.dirname(__file__),"..","data",
100+
"embedding_in_wx3.xrc")
101+
self.res = XmlResource(xrcfile)
100102

101103
# main frame and panel ---------
102104

0 commit comments

Comments
 (0)