summaryrefslogtreecommitdiffstats
path: root/Mac/Demo/PICTbrowse
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-08-27 21:41:23 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-08-27 21:41:23 (GMT)
commit3c06b9a7d4fa144eebd4786f71c4a301726e0c3c (patch)
tree4f9cdc3420a0b7d6cd76ec44245df09628e98993 /Mac/Demo/PICTbrowse
parenta5d7da528bda145426c50ad9ded8d0707d5f302c (diff)
downloadcpython-3c06b9a7d4fa144eebd4786f71c4a301726e0c3c.zip
cpython-3c06b9a7d4fa144eebd4786f71c4a301726e0c3c.tar.gz
cpython-3c06b9a7d4fa144eebd4786f71c4a301726e0c3c.tar.bz2
Use the new macresource module to open the accompanying resource file (if needed).
Diffstat (limited to 'Mac/Demo/PICTbrowse')
-rw-r--r--Mac/Demo/PICTbrowse/ICONbrowse.py10
-rw-r--r--Mac/Demo/PICTbrowse/PICTbrowse.py10
-rw-r--r--Mac/Demo/PICTbrowse/PICTbrowse2.py10
-rw-r--r--Mac/Demo/PICTbrowse/cicnbrowse.py14
-rw-r--r--Mac/Demo/PICTbrowse/oldPICTbrowse.py10
5 files changed, 12 insertions, 42 deletions
diff --git a/Mac/Demo/PICTbrowse/ICONbrowse.py b/Mac/Demo/PICTbrowse/ICONbrowse.py
index 162fcb6..902b5c7 100644
--- a/Mac/Demo/PICTbrowse/ICONbrowse.py
+++ b/Mac/Demo/PICTbrowse/ICONbrowse.py
@@ -10,6 +10,7 @@ from Carbon import List
import sys
import struct
from Carbon import Icn
+import macresource
#
# Resource definitions
@@ -26,14 +27,7 @@ MAXWIDTH=320
MAXHEIGHT=320
def main():
- try:
- dummy = Res.GetResource('DLOG', ID_MAIN)
- except Res.Error:
- try:
- Res.FSpOpenResFile("PICTbrowse.rsrc", 1)
- except Res.Error, arg:
- EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1])
- sys.exit(1)
+ macresource.need('DLOG', ID_MAIN, "PICTbrowse.rsrc")
ICONbrowse()
class ICONbrowse(FrameWork.Application):
diff --git a/Mac/Demo/PICTbrowse/PICTbrowse.py b/Mac/Demo/PICTbrowse/PICTbrowse.py
index e45b18c..41ffa5c 100644
--- a/Mac/Demo/PICTbrowse/PICTbrowse.py
+++ b/Mac/Demo/PICTbrowse/PICTbrowse.py
@@ -9,6 +9,7 @@ from Carbon import Controls
from Carbon import List
import sys
import struct
+import macresource
#
# Resource definitions
@@ -21,14 +22,7 @@ LEFT=200
TOP=64
def main():
- try:
- dummy = Res.GetResource('DLOG', ID_MAIN)
- except Res.Error:
- try:
- Res.FSpOpenResFile("PICTbrowse.rsrc", 1)
- except Res.Error, arg:
- EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1])
- sys.exit(1)
+ macresource.need('DLOG', ID_MAIN, "PICTbrowse.rsrc")
PICTbrowse()
class PICTbrowse(FrameWork.Application):
diff --git a/Mac/Demo/PICTbrowse/PICTbrowse2.py b/Mac/Demo/PICTbrowse/PICTbrowse2.py
index 7e146ed..0e11681 100644
--- a/Mac/Demo/PICTbrowse/PICTbrowse2.py
+++ b/Mac/Demo/PICTbrowse/PICTbrowse2.py
@@ -9,6 +9,7 @@ from Carbon import Controls
from Carbon import List
import sys
import struct
+import macresource
#
# Resource definitions
@@ -25,14 +26,7 @@ MAXWIDTH=320
MAXHEIGHT=320
def main():
- try:
- dummy = Res.GetResource('DLOG', ID_MAIN)
- except Res.Error:
- try:
- Res.FSpOpenResFile("PICTbrowse.rsrc", 1)
- except Res.Error, arg:
- EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1])
- sys.exit(1)
+ macresource.need('DLOG', ID_MAIN, "PICTbrowse.rsrc")
PICTbrowse()
class PICTbrowse(FrameWork.Application):
diff --git a/Mac/Demo/PICTbrowse/cicnbrowse.py b/Mac/Demo/PICTbrowse/cicnbrowse.py
index 89f8218..561dcf9 100644
--- a/Mac/Demo/PICTbrowse/cicnbrowse.py
+++ b/Mac/Demo/PICTbrowse/cicnbrowse.py
@@ -10,6 +10,7 @@ from Carbon import List
import sys
import struct
from Carbon import Icn
+import macresource
#
# Resource definitions
@@ -26,14 +27,7 @@ MAXWIDTH=320
MAXHEIGHT=320
def main():
- try:
- dummy = Res.GetResource('DLOG', ID_MAIN)
- except Res.Error:
- try:
- Res.FSpOpenResFile("PICTbrowse.rsrc", 1)
- except Res.Error, arg:
- EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1])
- sys.exit(1)
+ macresource.need('DLOG', ID_MAIN, "PICTbrowse.rsrc")
CIconbrowse()
class CIconbrowse(FrameWork.Application):
@@ -119,9 +113,9 @@ class MyDialog(FrameWork.DialogWindow):
def open(self, id, contents):
self.id = id
FrameWork.DialogWindow.open(self, ID_MAIN)
- self.wid.SetDialogDefaultItem(MAIN_SHOW)
+ self.dlg.SetDialogDefaultItem(MAIN_SHOW)
self.contents = contents
- self.ctl = self.wid.GetDialogItemAsControl(MAIN_LIST)
+ self.ctl = self.dlg.GetDialogItemAsControl(MAIN_LIST)
h = self.ctl.GetControlData_Handle(Controls.kControlListBoxPart,
Controls.kControlListBoxListHandleTag)
self.list = List.as_List(h)
diff --git a/Mac/Demo/PICTbrowse/oldPICTbrowse.py b/Mac/Demo/PICTbrowse/oldPICTbrowse.py
index 01cf71c..dc1f5b4 100644
--- a/Mac/Demo/PICTbrowse/oldPICTbrowse.py
+++ b/Mac/Demo/PICTbrowse/oldPICTbrowse.py
@@ -8,6 +8,7 @@ from Carbon import Win
from Carbon import List
import sys
import struct
+import macresource
#
# Resource definitions
@@ -20,14 +21,7 @@ LEFT=200
TOP=64
def main():
- try:
- dummy = Res.GetResource('DLOG', ID_MAIN)
- except Res.Error:
- try:
- Res.FSpOpenResFile("oldPICTbrowse.rsrc", 0)
- except Res.Error, arg:
- EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1])
- sys.exit(1)
+ macresource.need('DLOG', ID_MAIN, "oldPICTbrowse.rsrc")
PICTbrowse()
class PICTbrowse(FrameWork.Application):