]> granicus.if.org Git - python/commitdiff
e macresource.need() to open the W resource file in the application init
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 3 Apr 2002 21:52:10 +0000 (21:52 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 3 Apr 2002 21:52:10 +0000 (21:52 +0000)
code (if it isn't open already).

PythonIDE still opens the resource file "manually" because it also uses
presence of the CURS resource to determine whether it needs to adjust
sys.path.

Mac/Tools/IDE/Wapplication.py
Mac/Tools/IDE/Wminiapp.py

index ec0071f22bb72439cd6e00d007b2a2f992f28d51..27613f2cb42dc7c566d274e64e3d4b39bf532d45 100644 (file)
@@ -7,6 +7,7 @@ from Carbon import Events
 import traceback
 from types import *
 from Carbon import Menu; MenuToolbox = Menu; del Menu
+import macresource
 
 if hasattr(Win, "FrontNonFloatingWindow"):
        MyFrontWindow = Win.FrontNonFloatingWindow
@@ -19,6 +20,8 @@ KILLUNKNOWNWINDOWS = 0  # Set to 0 for debugging.
 class Application(FrameWork.Application):
        
        def __init__(self, signature='Pyth'):
+               # Open our resource file, if it is not open yet
+               macresource.need('CURS', 468, "Widgets.rsrc")
                import W
                W.setapplication(self, signature)
                FrameWork.Application.__init__(self)
index 3ebd226d48ed483691421ee11c3409217552f406..e09e3343d8ecea6280db82707bf39a0f2b72b080 100644 (file)
@@ -8,7 +8,7 @@ class TestApp(Wapplication.Application):
        
        def __init__(self):
                from Carbon import Res
-               macresource.open_pathname("Widgets.rsrc")
+#              macresource.open_pathname("Widgets.rsrc")
                self._menustocheck = []
                self.preffilepath = os.path.join("Python", "PythonIDE preferences")
                Wapplication.Application.__init__(self, 'Pyth')