summaryrefslogtreecommitdiffstats
path: root/Mac/Demo/PICTbrowse/cicnbrowse.py
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/cicnbrowse.py
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/cicnbrowse.py')
-rw-r--r--Mac/Demo/PICTbrowse/cicnbrowse.py14
1 files changed, 4 insertions, 10 deletions
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)