From: Kevin A. <ka...@us...> - 2005-12-25 17:12:04
|
Update of /cvsroot/pythoncard/PythonCard/samples/testevents In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18710/samples/testevents Modified Files: testevents.py Log Message: fixed on_openChildWindow_command by passing path to childWindow Index: testevents.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/samples/testevents/testevents.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** testevents.py 27 Sep 2004 16:55:49 -0000 1.21 --- testevents.py 25 Dec 2005 17:11:55 -0000 1.22 *************** *** 162,166 **** # in child function 10 ms in future print "openChildWindow command", event.target.name ! win = model.childWindow(self, MinimalChild) wx.FutureCall(10, win.callableFunction, "10 ms in the Future") wx.CallAfter(win.callableFunction, "via CallAfter") --- 162,176 ---- # in child function 10 ms in future print "openChildWindow command", event.target.name ! # KEA 2005-12-25 ! # the path for sys.modules[MinimalChild.__module__].__file__ ! # will be relative to the starting directory ! # so childWindow will fail if a resource file isn't provided ! # I'm not sure if this is a bug due to PythonCard changing the ! # directory to the application directory on startup or ! # the __file__ attribute already being set prior to our sys.path[0] ! # fix in model.py a combination of the two or something else. ! # However, always providing a resource path seems to work for ! # childWindow. ! win = model.childWindow(self, MinimalChild, 'testevents.rsrc.py') wx.FutureCall(10, win.callableFunction, "10 ms in the Future") wx.CallAfter(win.callableFunction, "via CallAfter") |