diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-08-27 21:41:23 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-08-27 21:41:23 (GMT) |
commit | 3c06b9a7d4fa144eebd4786f71c4a301726e0c3c (patch) | |
tree | 4f9cdc3420a0b7d6cd76ec44245df09628e98993 /Mac/Demo/example1 | |
parent | a5d7da528bda145426c50ad9ded8d0707d5f302c (diff) | |
download | cpython-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/example1')
-rw-r--r-- | Mac/Demo/example1/dnslookup-1.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Mac/Demo/example1/dnslookup-1.py b/Mac/Demo/example1/dnslookup-1.py index 9a2ab28..2aa7c88 100644 --- a/Mac/Demo/example1/dnslookup-1.py +++ b/Mac/Demo/example1/dnslookup-1.py @@ -7,6 +7,7 @@ from Carbon import Dlg import sys import socket import string +import macresource # # Definitions for our resources ID_MAIN=512 @@ -15,15 +16,10 @@ ITEM_LOOKUP_ENTRY=1 ITEM_RESULT=2 ITEM_LOOKUP_BUTTON=3 ITEM_QUIT_BUTTON=4 - - + def main(): """Main routine: open resource file, call dialog handler""" - try: - Res.FSpOpenResFile("dnslookup-1.rsrc", 1) - except Res.Error: - EasyDialogs.Message("Cannot open dnslookup-1.rsrc") - sys.exit(1) + macresource.need("DLOG", ID_MAIN, "dnslookup-1.rsrc") do_dialog() def do_dialog(): |