diff options
Diffstat (limited to 'Mac/Demo/PICTbrowse/cicnbrowse.py')
-rw-r--r-- | Mac/Demo/PICTbrowse/cicnbrowse.py | 14 |
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) |