Path: utzoo!attcan!uunet!snorkelwacker!apple!well!oster From: oster@well.sf.ca.us (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: Buttons in SFGetFile dialog Keywords: SFGetFile hook buttons custom Message-ID: <17215@well.sf.ca.us> Date: 13 Apr 90 14:43:37 GMT References: <1049@biar.UUCP> Reply-To: oster@well.UUCP (David Phillip Oster) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 29 In article <1049@biar.UUCP> trebor@biar.UUCP (Robert J Woodhead) writes: >Which means i have to alter a global from within the >hook routine. Which means futzing with the A5-WORLD. But, the hook routine is always run in a context where A5 is already set up correctly. If you can get at globals before you call SFGetfile(), you can get at your globals during SFGetFile(). THINK C makes it easy to get at globals, (except their SetUpA5() macro is not multi-finder compatible (or wasn't in version 3).) But, the general problem remains: How do you get at the globals. There is a stable tech note on setting up an A5 world in MPW. As for getting at it, I usually make LDEFs, CDEFs, WDEFs, etc be handles to code that looks like: JSR routineInMyApp that does the work rts application's A5 then the work routine allows for the extra address on the stack, (the different return address, pushed above the actual return address.) I have macros that expand to assembly language glue to save the calling a5 in a local, retrieve the application a5 from 2 after the return address, restore a5, and cleanup the stack ffor the procedure exit. -- -- David Phillip Oster - Note new address. Old one has gone Bye Bye. -- oster@well.sf.ca.us = {backbone}!well!oster