From: Kevin A. <ka...@us...> - 2004-09-14 17:33:12
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7657 Modified Files: model.py Log Message: removed pageWindow, changed childWindow to handle Notebook Index: model.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/model.py,v retrieving revision 1.182 retrieving revision 1.183 diff -C2 -d -r1.182 -r1.183 *** model.py 14 Sep 2004 17:28:45 -0000 1.182 --- model.py 14 Sep 2004 17:33:03 -0000 1.183 *************** *** 167,204 **** # figure out the .rsrc.py filename based on the module name stored in library.zip filename = os.path.split(sys.modules[frameClass.__module__].__file__)[1] ! filename = os.path.join(parent.application.applicationDirectory, filename) ! else: ! # figure out the .rsrc.py filename based on the module name ! filename = sys.modules[frameClass.__module__].__file__ ! # chop the .pyc or .pyo from the end ! base, ext = os.path.splitext(filename) ! filename = internationalResourceName(base) ! rsrc = resource.ResourceFile(filename).getResource() ! elif isinstance(rsrc, dict): ! rsrc = resource.Resource(rsrc) ! else: ! rsrc = resource.ResourceFile(filename).getResource() ! return frameClass(parent, rsrc.application.backgrounds[0]) ! ! ! # KEA 2004-09-14 ! # this is almost identical to childWindow above ! # but in the case of adding a page to a notebook ! # the parent is the Notebook component (wx.Notebook control) ! # which changes util.main_is_frozen code ! ! def pageWindow(parent, frameClass, filename=None, rsrc=None): ! if filename is None: ! if rsrc is None: ! if util.main_is_frozen(): ! # KEA 2004-05-20 ! # running standalone ! # need to support py2exe differently than bundlebuilder and mcmillan probably ! # but this is the py2exe 0.5 way ! # figure out the .rsrc.py filename based on the module name stored in library.zip ! filename = os.path.split(sys.modules[frameClass.__module__].__file__)[1] ! # parent will be the wx.Notebook ! parentFrame = parent.GetParent().GetParent() ! filename = os.path.join(parentFrame.application.applicationDirectory, filename) else: # figure out the .rsrc.py filename based on the module name --- 167,179 ---- # figure out the .rsrc.py filename based on the module name stored in library.zip filename = os.path.split(sys.modules[frameClass.__module__].__file__)[1] ! # KEA 2004-09-14 ! # it seems sort of dumb to duplicate this function ! # just to handle the parent differently ! # so I'm adding this check ! if isinstance(parent, wx.Notebook): ! parentFrame = parent.GetParent().GetParent() ! filename = os.path.join(parentFrame.application.applicationDirectory, filename) ! else: ! filename = os.path.join(parent.application.applicationDirectory, filename) else: # figure out the .rsrc.py filename based on the module name |