home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / csmpdigest / csmp-digest-v3-063 < prev    next >
Text File  |  2010-09-21  |  86KB  |  2,155 lines

  1. Received-Date: Thu, 6 Oct 1994 22:52:44 +0100
  2. From: pottier@clipper.ens.fr (Francois Pottier)
  3. Subject: csmp-digest-v3-063
  4. To: csmp-digest@ens.fr
  5. Date: Thu, 6 Oct 1994 22:52:40 +0100 (MET)
  6. X-Mailer: ELM [version 2.4 PL23]
  7. Mime-Version: 1.0
  8. Content-Type: text/plain; charset=ISO-8859-1
  9. Content-Transfer-Encoding: 8bit
  10. Errors-To: listman@ens.fr
  11. Reply-To: pottier@clipper.ens.fr
  12. X-Sequence: 68
  13.  
  14. C.S.M.P. Digest             Thu, 06 Oct 94       Volume 3 : Issue 63
  15.  
  16. Today's Topics:
  17.  
  18.         <command>+? == PLAIN STUPID!!! (true)
  19.         Apple Events Question
  20.         File System Manager Software Development Kit
  21.         GDGX Graphics Shell bus errors with GX Beta 3...
  22.         Getting Started (Summary)
  23.         Help: idle, shutdown, and MacTCP examples..
  24.         Pascal Flavours for Macintosh
  25.         Q: Script-Independant Command-Keys?
  26.         XCMD memory residence
  27.  
  28.  
  29.  
  30. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  31. (pottier@clipper.ens.fr).
  32.  
  33. The digest is a collection of article threads from the internet newsgroup
  34. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  35. regularly and want an archive of the discussions.  If you don't know what a
  36. newsgroup is, you probably don't have access to it.  Ask your systems
  37. administrator(s) for details.  If you don't have access to news, you may
  38. still be able to post messages to the group by using a mail server like
  39. anon.penet.fi (mail help@anon.penet.fi for more information).
  40.  
  41. Each issue of the digest contains one or more sets of articles (called
  42. threads), with each set corresponding to a 'discussion' of a particular
  43. subject.  The articles are not edited; all articles included in this digest
  44. are in their original posted form (as received by our news server at
  45. nef.ens.fr).  Article threads are not added to the digest until the last
  46. article added to the thread is at least two weeks old (this is to ensure that
  47. the thread is dead before adding it to the digest).  Article threads that
  48. consist of only one message are generally not included in the digest.
  49.  
  50. The digest is officially distributed by two means, by email and ftp.
  51.  
  52. If you want to receive the digest by mail, send email to listserv@ens.fr
  53. with no subject and one of the following commands as body:
  54.     help                        Sends you a summary of commands
  55.     subscribe csmp-digest Your Name    Adds you to the mailing list
  56.     signoff csmp-digest            Removes you from the list
  57. Once you have subscribed, you will automatically receive each new
  58. issue as it is created.
  59.  
  60. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  61. Questions related to the ftp site should be directed to
  62. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  63. digest are available there.
  64.  
  65. Also, the digests are available to WAIS users.  To search back issues
  66. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  67. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  68.  
  69.  
  70. -------------------------------------------------------
  71.  
  72. >From alun@isy.liu.se (Anders Lundqvist)
  73. Subject: <command>+? == PLAIN STUPID!!! (true)
  74. Date: 19 Sep 1994 06:42:44 GMT
  75. Organization: Dept. of E.E., Univ. of Linkoping
  76.  
  77. Greetings all programmers!
  78.  
  79. I wonder how many of you that implement keyboard shortcuts 
  80. like <command>+? realize that these DO NOT work on many 
  81. international keyboard layouts like the swedish????
  82.  
  83. Why? Because in order to produce a question mark I need to 
  84. use the shift key and since the command key disables the shift
  85. key, this doesn't work. I have been playing around with the DA
  86. Keyboard and there's simply no way around. Obiwan uses <command>+`
  87. and this I can emulate by pressing <command>+<option>+<control>+'.
  88. Sigh...
  89.  
  90. Of course, this wouldn't been so bad if there was an equivalent 
  91. meny command, but in many cases there isn't. Usually <command>+?
  92. invokes some help mode and turns the pointer into a question mark
  93. to allow the user to point at an object (e.g Disinfectant and 
  94. Mathematica). 
  95.  
  96. IS THIS PROBLEM MENTIONED IN THE HUMAN INTERFACE GUIDELINES???
  97.  
  98.  
  99. Thank you for any feedback!
  100.  
  101. Anders Lundqvist
  102. Department of EE
  103. Linkoping University
  104. Sweden
  105.   
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113. +++++++++++++++++++++++++++
  114.  
  115. >From philip@cs.wits.ac.za (Philip Machanick)
  116. Date: 19 Sep 1994 08:16:47 GMT
  117. Organization: Computer Science Dept, U of Witwatersrand
  118.  
  119. In article <35jbt4$mac@newsy.ifm.liu.se>, alun@isy.liu.se wrote:
  120.  
  121. > Why? Because in order to produce a question mark I need to 
  122. > use the shift key and since the command key disables the shift
  123. > key, this doesn't work.
  124.  
  125. This is also true on the English and US keyboards: "?" is shift-/. Where
  126. did you get the idea that command disables shift? All the modifiers are
  127. independent and can be sensed independently. If COMMAND-? is not working
  128. for you there must be some other explanation.
  129. -- 
  130. Philip Machanick                   philip@cs.wits.ac.za
  131. Department of Computer Science, University of the Witwatersrand
  132. 2050 Wits, South Africa        (at University of Cape Town 4 July-7 Nov)
  133. phone 27(11)716-3309  fax 27(11)339-7965
  134.  
  135. +++++++++++++++++++++++++++
  136.  
  137. >From resnick@uiuc.edu (Pete Resnick)
  138. Date: Mon, 19 Sep 1994 08:35:23 -0500
  139. Organization: University of Illinois at Urbana-Champaign
  140.  
  141. In article <philip-1909941017020001@mackerel.cs.uct.ac.za>,
  142. philip@cs.wits.ac.za (Philip Machanick) wrote:
  143.  
  144. > In article <35jbt4$mac@newsy.ifm.liu.se>, alun@isy.liu.se wrote:
  145. > > Why? Because in order to produce a question mark I need to 
  146. > > use the shift key and since the command key disables the shift
  147. > > key, this doesn't work.
  148. > This is also true on the English and US keyboards: "?" is shift-/. Where
  149. > did you get the idea that command disables shift? All the modifiers are
  150. > independent and can be sensed independently. If COMMAND-? is not working
  151. > for you there must be some other explanation.
  152.  
  153. You're wrong Phil. Command does in fact disable the shift modifier. See
  154. the tech note on International Cancelling. To properly handle the command
  155. key in your application, you should always strip the command-key bit out
  156. of the modifiers field and re-pass the keystroke through KeyTrans. Here's
  157. some source code for doing it with the cancel key, but you should use
  158. similar code for any command-key combination (like in MenuKey):
  159.  
  160. /* These both use Universal Headers. The second is for System 6 too. */
  161.  
  162. Boolean WasCancel(EventRecord *theEvent)
  163. {
  164.     short keyCode;
  165.     long state = 0L, test;
  166.     unsigned long keys;
  167.     
  168.     if(!(theEvent->modifiers & cmdKey))
  169.         return(false);
  170.     keyCode = (theEvent->modifiers & 0xFE00) |
  171.               ((theEvent->message & keyCodeMask) >> 8);
  172.     keys = KeyTranslate((Ptr)GetScriptManagerVariable(smKCHRCache),
  173.                         keyCode, &state);
  174.     return(((Byte)keys == '.') || ((Byte)(keys >>= 16) == '.'));
  175. }
  176.  
  177. Boolean WasCancelSystem6or7(EventRecord *theEvent)
  178. {
  179.     short keyCode, rsrcID, scriptID;
  180.     Ptr kchrPtr;
  181.     Handle kchrRsrc = nil;
  182.     long state = 0L;
  183.     unsigned long keys;
  184.     
  185.     if(!(theEvent->modifiers & cmdKey))
  186.         return(false);
  187.     keyCode = (theEvent->modifiers & 0xFE00) |
  188.               ((theEvent->message & keyCodeMask) >> 8);
  189.     if((kchrPtr = (Ptr)GetScriptManagerVariable(smKCHRCache)) == nil) {
  190.         scriptID = GetScriptManagerVariable(smKeyScript);
  191.         rsrcID = GetScriptVariable(scriptID, smScriptKeys);
  192.         kchrRsrc = GetResource('KCHR', rsrcID);
  193.         if(kchrRsrc != nil)
  194.             kchrPtr = *kchrRsrc;
  195.     }
  196.     if(kchrPtr != nil)
  197.         keys = KeyTranslate(kchrPtr, keyCode, &state);
  198.     if(kchrRsrc != nil)
  199.         ReleaseResource(kchrRsrc);
  200.     return(((Byte)keys == '.') || ((Byte)(keys >>= 16) == '.'));
  201. }
  202. -- 
  203. Pete Resnick    (...so what is a mojo, and why would one be rising?)
  204. Doctoral Student - Philosophy Department, Gregory Hall, UIUC
  205. System manager - Cognitive Science Group, Beckman Institute, UIUC
  206. Internet: resnick@uiuc.edu
  207.  
  208. +++++++++++++++++++++++++++
  209.  
  210. >From alun@isy.liu.se (Anders Lundqvist)
  211. Date: 19 Sep 1994 13:31:07 GMT
  212. Organization: Dept. of E.E., Univ. of Linkoping
  213.  
  214. In article 1909941017020001@mackerel.cs.uct.ac.za, philip@cs.wits.ac.za (Philip Machanick) writes:
  215. >In article <35jbt4$mac@newsy.ifm.liu.se>, alun@isy.liu.se wrote:
  216. >
  217. >> Why? Because in order to produce a question mark I need to 
  218. >> use the shift key and since the command key disables the shift
  219. >> key, this doesn't work.
  220. >
  221. >This is also true on the English and US keyboards: "?" is shift-/. Where
  222. >did you get the idea that command disables shift? All the modifiers are
  223. >independent and can be sensed independently. If COMMAND-? is not working
  224. >for you there must be some other explanation.
  225. >-- 
  226. >Philip Machanick                   philip@cs.wits.ac.za
  227. >Department of Computer Science, University of the Witwatersrand
  228. >2050 Wits, South Africa        (at University of Cape Town 4 July-7 Nov)
  229. >phone 27(11)716-3309  fax 27(11)339-7965
  230.  
  231. I'll try again...
  232.  
  233. On my keybord the "?" is located next to the "0" (zero) key and is 
  234. <shift>+"+". If I use the DA Keyboard and press the shift key then all
  235. letters turn into capital letters and the "+" sign turns into a question 
  236. mark. OK! If I now keep the shift key pressed and press the <command> key
  237. all letter go back to normal and the "?" is transmogrified into a "+" again.
  238.  
  239. Does this happen to you? If it does and you can use <command>+"?" then I'm 
  240. completely lost...
  241.  
  242. Of course, everything works as a charm if I turn on the US keyboard layout.
  243.  
  244.  
  245. Anders Lundqvist
  246. Department of EE
  247. Linkoping University
  248. Sweden
  249.  
  250.  
  251.  
  252. +++++++++++++++++++++++++++
  253.  
  254. >From pcastine@prz.tu-berlin.de (Peter Castine)
  255. Date: Mon, 19 Sep 1994 15:19:45 GMT
  256. Organization: Process Control Center
  257.  
  258. In article <philip-1909941017020001@mackerel.cs.uct.ac.za>,
  259. philip@cs.wits.ac.za (Philip Machanick) wrote:
  260.  
  261. > In article <35jbt4$mac@newsy.ifm.liu.se>, alun@isy.liu.se wrote:
  262. > > Why? Because in order to produce a question mark I need to 
  263. > > use the shift key and since the command key disables the shift
  264. > > key, this doesn't work.
  265. > This is also true on the English and US keyboards: "?" is shift-/. Where
  266. > did you get the idea that command disables shift? All the modifiers are
  267. > independent and can be sensed independently. If COMMAND-? is not working
  268. > for you there must be some other explanation.
  269.  
  270. Anders is right--if the command-shift-anything is pressed, the ASCII code
  271. of the unshifted character is returned in event record. If the programmer
  272. wants to get the shifted character, she needs to reprocess the key code
  273. with the cmdKey bit in the modifiers field reset. This was all discussed
  274. years ago in a Tech Note called ``International Cancelling'', it gave code
  275. for correctly detecting command-period on all keyboards. 
  276.  
  277. Don't ask me where the code is in NIM, I don't know. You can also find the
  278. technique in use in the TCL source.
  279.  
  280. The trick with Mathematica is that, although it tells you to use Cmd-?, it
  281. really is looking for Cmd-/. There is a possibility that, upon finding '/'
  282. in the event record, it checks if both the shift and command keys are
  283. pressed, but that still won't help you if '?' is someplace different from
  284. it's position on the American Sholes (QWERTY) keyboard layout. 
  285.  
  286. Someday I'm gonna write an application that uses Command-‹ (that's
  287. U-Umlaut if you're not reading on a Mac), just to let some people find out
  288. what it feels like.
  289.  
  290. BTW, there is one work-around for Anders problem: switch to the U.S.
  291. keyboard layout, at least when you want to get that nifty ?-cursor. This
  292. is a pain in the neck, but there are a couple of short cuts you can
  293. take--mail me if you want details.
  294.  
  295. -- 
  296. -Peter Castine--pcastine@prz.tu-berlin.de--Process Control Center--TU Berlin-
  297. *  A New York City judge ruled that if two women behind you at the movies   *
  298. *  insist on discussing the probable outcome of the film, you have the      *
  299. *  right to turn around and blow a Bronx cheer at them.                     *
  300.  
  301. +++++++++++++++++++++++++++
  302.  
  303. >From philip@cs.wits.ac.za (Philip Machanick)
  304. Date: 19 Sep 1994 15:01:50 GMT
  305. Organization: Computer Science Dept, U of Witwatersrand
  306.  
  307. In article <35k3qr$28b@newsy.ifm.liu.se>, alun@isy.liu.se wrote:
  308.  
  309. > On my keybord the "?" is located next to the "0" (zero) key and is 
  310. > <shift>+"+". If I use the DA Keyboard and press the shift key then all
  311. > letters turn into capital letters and the "+" sign turns into a question 
  312. > mark. OK! If I now keep the shift key pressed and press the <command> key
  313. > all letter go back to normal and the "?" is transmogrified into a "+" again.
  314. > Does this happen to you? If it does and you can use <command>+"?" then I'm 
  315. > completely lost...
  316.  
  317. If I use the DA, the same thing happens yet I can use command-? in MS Word
  318. etc. Maybe Pete Resnick's article throws some light on this but it's not
  319. instantly clear why this should be different for a different keyboard
  320. layout (on the US keyboard on my PB170 "?" is SHIFT-/).
  321. -- 
  322. Philip Machanick                   philip@cs.wits.ac.za
  323. Department of Computer Science, University of the Witwatersrand
  324. 2050 Wits, South Africa        (at University of Cape Town 4 July-7 Nov)
  325. phone 27(11)716-3309  fax 27(11)339-7965
  326.  
  327. +++++++++++++++++++++++++++
  328.  
  329. >From stk@uropax.contrib.de (Stefan Kurth)
  330. Date: 20 Sep 1994 01:36:04 +0200
  331. Organization: none
  332.  
  333. In article <35jbt4$mac@newsy.ifm.liu.se>, alun@isy.liu.se (Anders
  334. Lundqvist) wrote:
  335.  
  336. > I wonder how many of you that implement keyboard shortcuts 
  337. > like <command>+? realize that these DO NOT work on many 
  338. > international keyboard layouts like the swedish????
  339. > Why? Because in order to produce a question mark I need to 
  340. > use the shift key and since the command key disables the shift
  341. > key, this doesn't work.
  342. >
  343. > IS THIS PROBLEM MENTIONED IN THE HUMAN INTERFACE GUIDELINES???
  344.  
  345. It is mentioned in NIM: Text, page C-23. And if all programs were
  346. well-behaved and handled these things like Apple tells us, you would
  347. have no problems.
  348.  
  349. The solution is to strip the cmdKey bit from theEvent.modifiers, and
  350. then run it through KeyTrans() again before passing it to MenuKey().
  351.  
  352. (BTW, I just tried it in Disinfectant, and it works fine for me; and I
  353.  have a German keyboard which I guess is similar to yours.)
  354.  
  355. Actually, some programs don't check for command-? at all, but instead
  356. they check whether the shift key is down, and if it is, they check for
  357. command-/ (because shift-/ yields ? on a US keyboard). Thus, you might
  358. try command-shift-/ on your keyboard and see if it works.
  359.  
  360. Cheers,
  361.   -Stefan
  362.  
  363. ________________________________________________________________________
  364. Stefan Kurth                 Berlin, Germany              stk@contrib.de
  365.  
  366. +++++++++++++++++++++++++++
  367.  
  368. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  369. Date: Tue, 20 Sep 1994 11:30:09 +0800
  370. Organization: Department of Computer Science, The University of Western Australia
  371.  
  372. In article <35jbt4$mac@newsy.ifm.liu.se>, alun@isy.liu.se wrote:
  373.  
  374. >Greetings all programmers!
  375.  
  376. Anders, you think *you've* got problems, us Dvorak keyboards users have to
  377. put up with certain applications (like Photoshop 2.x and BBEdit 3.0 and
  378. certain bits of HC 2.x) where it ignores the command-key table in the KCHR
  379. and decides to use Dvorak command keys instead of QWERTY ones.  Do you
  380. have any idea how annoying it is to hit command-X (to do a Cut) and have
  381. the application quit.  *grrr*
  382. -- 
  383. Quinn "The Eskimo!"        "Kids, 3D and driving just don't mix."
  384.   So many gumbies, so few ICBMs.
  385.   Still using BBEdit 2.3.2.
  386.  
  387. +++++++++++++++++++++++++++
  388.  
  389. >From h+@nada.kth.se (Jon W{tte)
  390. Date: Tue, 20 Sep 1994 10:36:02 +0200
  391. Organization: Royal Institute of Something or other
  392.  
  393. In article <35jbt4$mac@newsy.ifm.liu.se>,
  394. alun@isy.liu.se (Anders Lundqvist) wrote:
  395.  
  396. >IS THIS PROBLEM MENTIONED IN THE HUMAN INTERFACE GUIDELINES???
  397.  
  398. Yes, it is. Applications are suggested only to use letters, and 
  399. where they use non-letters, to do the keyboard translation 
  400. themselves using KeyTrans with the command key stripped off
  401. or something to that effect.
  402.  
  403. The easy thing for a user to do is to extract the Swedish 
  404. keyboard layout in ResEdit and change it to care about shift 
  405. with command down (that's just a simple re-binding)
  406.  
  407. However, you immediately get a new problem; cmd-shift-digit 
  408. means FKEY, and the international shifted numbers aren't the 
  409. same as the US ones (on my keyboard, from 1 through 0, it's:
  410. bang quote hash sun percent ampersand slash leftparen 
  411. rightparen equal, or as you may, potion amulet sink unknown 
  412. food demon wawwnd tool armor ring :-)
  413.  
  414. Now, FoxPro for Macintosh uses cmd-F1 cmd-F2 etc for commands 
  415. that aren't edit commands, so it could be worse (I don't have 
  416. command keys on my keyboard) But then, FPfM says it supports 
  417. the full power of AppleEvents and AppleScripts, when the only 
  418. non-required AE they support is the DoScript one. Lame, and 
  419. misleading.
  420.  
  421. Cheers,
  422.  
  423.                     / h+
  424.  
  425.  
  426. --
  427.   Jon W‰tte (h+@nada.kth.se), Hagagatan 1, 113 48 Stockholm, Sweden
  428.  V}ga v{gra nonkonformism!
  429.  
  430.  
  431. +++++++++++++++++++++++++++
  432.  
  433. >From pcastine@prz.tu-berlin.de (Peter Castine)
  434. Date: Tue, 20 Sep 1994 10:00:17 GMT
  435. Organization: Process Control Center
  436.  
  437. In article <35l794$s3j@uropax.contrib.de>, stk@uropax.contrib.de (Stefan
  438. Kurth) wrote:
  439.  
  440. > Actually, some programs don't check for command-? at all, but instead
  441. > they check whether the shift key is down, and if it is, they check for
  442. > command-/ (because shift-/ yields ? on a US keyboard). Thus, you might
  443. > try command-shift-/ on your keyboard and see if it works.
  444.  
  445. The problem is that this won't work if the slash (/) itself is a shift-key
  446. combination as it is, for instance, on the German keyboard (/ == shift-7).
  447.  
  448. So, the only solution for Anders' problem (short of switching to the U.S.
  449. keyboard layout) seems to be to use QuicKeys. Of course, if the command
  450. isn't available in a menu somewhere, he won't have luck with that, either.
  451.  
  452. I sense a moral here: Don't implement command-key shortcuts that *aren't*
  453. available through menus. Hey, if the cmd-key equivalents were for menu
  454. commands, Anders could just tweak the appropriate resources. (Won't work
  455. for MS products, but, hey, nothing works for MS products ;-} ).
  456.  
  457. Cheers
  458.  
  459. -- 
  460. -Peter Castine--pcastine@prz.tu-berlin.de--Process Control Center--TU Berlin-
  461. *  A New York City judge ruled that if two women behind you at the movies   *
  462. *  insist on discussing the probable outcome of the film, you have the      *
  463. *  right to turn around and blow a Bronx cheer at them.                     *
  464.  
  465. +++++++++++++++++++++++++++
  466.  
  467. >From rollin@newton.apple.com (Keith Rollin)
  468. Date: Wed, 21 Sep 1994 04:06:34 -0800
  469. Organization: Apple ][ -> Mac -> Taligent -> Newton -> Windows?
  470.  
  471. In article <35jbt4$mac@newsy.ifm.liu.se>, alun@isy.liu.se wrote:
  472.  
  473. >I wonder how many of you that implement keyboard shortcuts 
  474. >like <command>+? realize that these DO NOT work on many 
  475. >international keyboard layouts like the swedish????
  476.  
  477. FYI, the '?' key is shifted on US layouts, too.
  478.  
  479.  
  480. >
  481. >Why? Because in order to produce a question mark I need to 
  482. >use the shift key and since the command key disables the shift
  483. >key, this doesn't work. I have been playing around with the DA
  484. >Keyboard and there's simply no way around. Obiwan uses <command>+`
  485. >and this I can emulate by pressing <command>+<option>+<control>+'.
  486. >Sigh...
  487. >
  488. >Of course, this wouldn't been so bad if there was an equivalent 
  489. >meny command, but in many cases there isn't. Usually <command>+?
  490. >invokes some help mode and turns the pointer into a question mark
  491. >to allow the user to point at an object (e.g Disinfectant and 
  492. >Mathematica). 
  493. >
  494. >IS THIS PROBLEM MENTIONED IN THE HUMAN INTERFACE GUIDELINES???
  495.  
  496. There's a technote called "International Canceling" that deals with this
  497. issue. It focuses on the fact that '.' is sometimes a shifted character
  498. (the technote cites the Italian keyboard as an example), and shows how to
  499. get around the fact that Shift is ignored when Command is pressed. If
  500. programmers care to get it right, the information is available.
  501.  
  502. - --------------------------------------------------------------------------
  503. Keith Rollin --- Phantom Programmer --- Apple Computer, Inc. --- Team Newton
  504.  
  505. ---------------------------
  506.  
  507. >From westwig@msc.cornell.edu (Erik Anton Westwig)
  508. Subject: Apple Events Question
  509. Date: Wed, 21 Sep 1994 10:11:54 -0500
  510. Organization: Cornell University
  511.  
  512. I'm trying to finally learn about Apple Events, but I'm having some
  513. problems
  514. understanding something quite fundamental:
  515.  
  516. Consider the first required AE: Open Application
  517.   When the Finder starts my App, it calls the Process Manager to launch it
  518.   and then sticks a kAEOpenApplication high-level event into my queue. I
  519.   think I got that part, but because I want my app to be as friendly as
  520.   possible to older systems (without AEs) I wouldn't want to stick ANY code
  521.   in the OpenApp routine that is necessary to the starting of my program.
  522.   I can't see what I would do differently in the OpenApp routine than I
  523.   would do in the non AE environment --> so I guess what I'm saying is I
  524. don't
  525.   understand why this is an important event to support.
  526.   Am I completely missing the whole point here, or what?
  527.  
  528. I think I see how the QuitApp event is different: it gives my App a chance
  529. to
  530. shut down itself gracefully (e.g. asking the user if they want to save open
  531. documents, etc.)
  532.  
  533. Thanks,
  534. ERIK
  535.  
  536. +++++++++++++++++++++++++++
  537.  
  538. >From Jeremy@dewey.soe.berkeley.edu (Jeremy Roschele)
  539. Date: Wed, 21 Sep 1994 08:09:28 -0800
  540. Organization: SimCalc Project
  541.  
  542. In article <westwig-210994101154@132.236.102.71>, westwig@msc.cornell.edu
  543. (Erik Anton Westwig) wrote:
  544.  
  545. >   I can't see what I would do differently in the OpenApp routine than I
  546. >   would do in the non AE environment --> so I guess what I'm saying is I
  547. > don't
  548. >   understand why this is an important event to support.
  549. >   Am I completely missing the whole point here, or what?
  550.  
  551. On the Open Application event you should create a blank document. The
  552. Finder won't send OApp if it is printing, or the user launched with a
  553. document.
  554.  
  555. jeremy
  556.  
  557. +++++++++++++++++++++++++++
  558.  
  559. >From jwbaxter@olympus.net (John W. Baxter)
  560. Date: Wed, 21 Sep 1994 13:26:08 -0700
  561. Organization: Internet for the Olympic Peninsula
  562.  
  563. In article <westwig-210994101154@132.236.102.71>, westwig@msc.cornell.edu
  564. (Erik Anton Westwig) wrote:
  565.  
  566. > I'm trying to finally learn about Apple Events, but I'm having some
  567. > problems
  568. > understanding something quite fundamental:
  569. > Consider the first required AE: Open Application
  570. >   When the Finder starts my App, it calls the Process Manager to launch it
  571. >   and then sticks a kAEOpenApplication high-level event into my queue. I
  572. >   think I got that part, but because I want my app to be as friendly as
  573. >   possible to older systems (without AEs) I wouldn't want to stick ANY code
  574. >   in the OpenApp routine that is necessary to the starting of my program.
  575. >   I can't see what I would do differently in the OpenApp routine than I
  576. >   would do in the non AE environment --> so I guess what I'm saying is I
  577. > don't
  578. >   understand why this is an important event to support.
  579. >   Am I completely missing the whole point here, or what?
  580.  
  581. When your application starts, and realizes that Apple events are active
  582. (all my apps realize that, because I don't write for System 6 any more),
  583. it should do what needs to be done every time it starts up.  None of this
  584. will be visible to a user.
  585.  
  586. When an Open Application event comes in, the app should do what it does
  587. when it is double-clicked on in the Finder.  Often, that is to create and
  588. open a new untitled document...sometimes it isn't.  At one time, Apple
  589. suggested not doing that if an Open Application appears after the app is
  590. happily doing things.  Recently, it seems that Apple may in the future
  591. want the open a new untitled document behavior in that case, as an
  592. "improvement" to the Mac look and feel.  So you probably should just go
  593. ahead and handle Open Application whenever it shows up.
  594.  
  595. When an Open Document comes in before the Open Application, it means that
  596. one or more docs were double-clicked rather than your application. 
  597. Normally, you would open them (assuming that's what your application
  598. does).  Print Document may appear rather than Open Document...this becomes
  599. more important with QuickDraw GX than it was with most users before, since
  600. it's how you find out that a user has dragged one of your docs to a
  601. desktop printer.
  602.  
  603. Another possibility is that an 'ascr'/'noop'  (I think 'noop' is right)
  604. event appears.  Something else will happen later.  Most apps can simple
  605. ignore this event, which says "I'll tell you later why you were started". 
  606. But some apps may need to know.
  607.  
  608.    --John
  609.  
  610. -- 
  611. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  612.    "Occasionally...astronomers add a second to either June 31 or
  613.     December 31..."   IM: OS Utilities, p 4-12
  614.    jwbaxter@pt.olympus.net
  615.  
  616. +++++++++++++++++++++++++++
  617.  
  618. >From westwig@msc.cornell.edu (Erik Anton Westwig)
  619. Date: Wed, 21 Sep 1994 18:35:46 -0500
  620. Organization: Cornell University
  621.  
  622. In article <Jeremy-2109940809280001@now-and-zen.hip.berkeley.edu>,
  623. Jeremy@dewey.soe.berkeley.edu (Jeremy Roschele) wrote:
  624.  
  625. > On the Open Application event you should create a blank document. The
  626. > Finder won't send OApp if it is printing, or the user launched with a
  627. > document.
  628. > jeremy
  629.  
  630. yup, i get that part.  But what I don't see is what I need to do
  631. differently
  632. than before (without the AEs).  To be pre system 7 friendly, I need to be
  633. able
  634. to open my blank document without using the KAEOpenApplication event,
  635. anyway.
  636.  
  637. ERIK
  638.  
  639. +++++++++++++++++++++++++++
  640.  
  641. >From jwbaxter@olympus.net (John W. Baxter)
  642. Date: Wed, 21 Sep 1994 19:42:44 -0700
  643. Organization: Internet for the Olympic Peninsula
  644.  
  645. In article <westwig-210994183547@132.236.102.67>, westwig@msc.cornell.edu
  646. (Erik Anton Westwig) wrote:
  647.  
  648. > In article <Jeremy-2109940809280001@now-and-zen.hip.berkeley.edu>,
  649. > Jeremy@dewey.soe.berkeley.edu (Jeremy Roschele) wrote:
  650. >  
  651. > > On the Open Application event you should create a blank document. The
  652. > > Finder won't send OApp if it is printing, or the user launched with a
  653. > > document.
  654. > > 
  655. > > jeremy
  656. > yup, i get that part.  But what I don't see is what I need to do
  657. > differently
  658. > than before (without the AEs).  To be pre system 7 friendly, I need to be
  659. > able
  660. > to open my blank document without using the KAEOpenApplication event,
  661. > anyway.
  662.  
  663. The sample code in Inside Mac: IAC shows how to detect whether you should
  664. wait for the 'oapp' because it's coming, or not.  I think the discussion
  665. in Think Reference also does.  --John
  666.  
  667. -- 
  668. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  669.    "Occasionally...astronomers add a second to either June 31 or
  670.     December 31..."   IM: OS Utilities, p 4-12
  671.    jwbaxter@pt.olympus.net
  672.  
  673. +++++++++++++++++++++++++++
  674.  
  675. >From h+@nada.kth.se (Jon W{tte)
  676. Date: Thu, 22 Sep 1994 16:11:18 +0200
  677. Organization: Royal Institute of Something or other
  678.  
  679. In article <westwig-210994183547@132.236.102.67>,
  680. westwig@msc.cornell.edu (Erik Anton Westwig) wrote:
  681.  
  682. >yup, i get that part.  But what I don't see is what I need to do
  683. >differently
  684. >than before (without the AEs).  To be pre system 7 friendly, I need to be
  685. >able
  686. >to open my blank document without using the KAEOpenApplication event,
  687. >anyway.
  688.  
  689. Well, the logic goes like this:
  690.  
  691. On startup:
  692.  
  693. if (hasn't got AppleEvents) then
  694.     if (CountAppFiles) then
  695.         Open or Print files
  696.     else
  697.         Make new document
  698. else
  699.     Install AppleEvent Handlers
  700.  
  701.  
  702. on OpenApplication:
  703.     Make new document
  704.  
  705. on OpenDocument:
  706.     Open files
  707.  
  708. on PrintDocument:
  709.     Print files
  710.  
  711.  
  712. As you see, you should separate the actions (opening/printing 
  713. documents or making new documents) from their triggers 
  714. (starting up and/or choosing the menu items)
  715.  
  716. For instance, you wouldn't want your app to create a blank 
  717. document before receiving an open documents appleevent when the 
  718. user double-clicks a document in the Finder under system 7.
  719.  
  720. Cheers,
  721.  
  722.                 / h+
  723.  
  724.  
  725. --
  726.   Jon W‰tte (h+@nada.kth.se), Hagagatan 1, 113 48 Stockholm, Sweden
  727.  
  728. "TextEdit does everything right."
  729.     ã Jon W{tte
  730.  
  731.  
  732. ---------------------------
  733.  
  734. >From jumplong@aol.com (Jump Long)
  735. Subject: File System Manager Software Development Kit
  736. Date: 15 Sep 1994 00:28:01 -0400
  737. Organization: America Online, Inc. (1-800-827-6364)
  738.  
  739. Apple Developers:
  740.  
  741. The File System Manager Software Development Kit (SDK) version 1.2 is
  742. available on Apple's ftp server at:
  743.  
  744. ftp.apple.com (IP 130.43.2.3)
  745.  
  746. /ftp/dts/mac/sys.soft/extensions/file-system-manager-sdk.hqx
  747.  
  748. The FSM SDK will be on Developer CDs and on AppleLink in the future.
  749.  
  750. Archive Contents
  751. - --------------
  752.  
  753. * File System Manager -- A system extension which implements version 1.2
  754. of FSM and the extended Disk Initialization Package. This extension is
  755. compatible with System 7.0 and later. If in future system software, we
  756. make changes to FSM, the File System Manager extension will disable
  757. itself.
  758.  
  759. * FSMGlueLib.o -- The glue code for the File System Manager service
  760. routines.
  761.  
  762. * FSM.h. FSM.p and FSM.a -- The Universal Interface files for the File
  763. System Manager. This version of the interface files was built to work with
  764. the Universal Interfaces 2.0a1 from ETO #15, MPW prerelease. However, for
  765. 68K development (which we expect all foreign file systems to be), FSM.h
  766. works perfectly with the current release of Universal Interfaces on ETO
  767. #15.
  768.  
  769. * Guide - File System Manager -- The documentation for the File System
  770. Manager in Apple DocViewer format. The latest version of the Apple
  771. DocViewer application can be found on any recent Developer CD.
  772.  
  773. Licensing Information
  774. - -------------------
  775.  
  776. The File System Manager extension version 1.2 may be licensed for
  777. distribution. Contact Apple Software Licensing at:
  778.  
  779.      Software Licensing
  780.      Apple Computer, Inc.
  781.      2420 Ridgepoint Drive, MS: 198-SWL
  782.      Austin, TX  78754
  783.      512 919-2645
  784.      AppleLink: SW.LICENSE
  785.  
  786. The File System Manager Development and Developer Support Team
  787.  
  788. (I told ya we'd make it available when it was done - Jim Luther)
  789.  
  790. +++++++++++++++++++++++++++
  791.  
  792. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  793. Date: Fri, 16 Sep 1994 10:57:22 +0800
  794. Organization: Department of Computer Science, The University of Western Australia
  795.  
  796. In article <358igh$sme@search01.news.aol.com>, jumplong@aol.com (Jump
  797. Long) wrote:
  798.  
  799. >(I told ya we'd make it available when it was done - Jim Luther)
  800.  
  801. (:  Yay Jim!
  802. -- 
  803. Quinn "The Eskimo!"        "Scout in a can. Simple, cheap, easy
  804.                             to use and it's expendable!"
  805.  
  806. +++++++++++++++++++++++++++
  807.  
  808. >From jumplong@aol.com (Jump Long)
  809. Date: 17 Sep 1994 14:57:02 -0400
  810. Organization: America Online, Inc. (1-800-827-6364)
  811.  
  812. In article <rmah-1509940108340001@rmah.dialup.access.net>, rmah@panix.com
  813. (Robert Mah) writes:
  814.  
  815. >Please pardon my ignorance, but I have one question.  What does it do?
  816.  
  817. Here's some meterial cut from the FSM docs which should answer this
  818. question:
  819.  
  820. "The File System Manager is the part of the Macintosh Operating System
  821. that manages the use of foreign file systems. The File System Manager
  822. provides a general means by which foreign file systems can be installed,
  823. identified, and interfaced to the Operating System.
  824.  
  825. The Operating System services provided by the File System Manager are
  826. called FSM components and the interface mechanism between an foreign file
  827. system and a particular FSM component is known as a FSM component
  828. interface. At this time, two FSM component interface are defined for use
  829. under the File System Manager
  830.  
  831. * the HFS Component Interface which allows a foreign file system to
  832. process File Manager requests
  833.  
  834. * the Disk Initialization Package Component Interface which allows foreign
  835. file systems to initialize foreign file system volumes on a Macintosh"
  836.  
  837.  
  838. FSM also includes the File System Utility Routines which help you write a
  839. foreign file system. Here's the description of those utilities:
  840.  
  841. "The File System Utility routines are intended for use by foreign file
  842. systems to allow your foreign file system to
  843.  
  844. * access file control blocks (FCBs), volume control blocks (VCBs), working
  845. directory control blocks (WDCBs), and drive queue elements (DrvQEl)
  846.  
  847. * set and get the default volume and working directory
  848.  
  849. * eject a volume
  850.  
  851. * validate and process parameters passed with Macintosh file system calls
  852.  
  853. * access the Macintosh file system's cache buffers and low-level I/O
  854. services"
  855.  
  856.  
  857. Writing a foreign file system is by no means simple, but we've tried to
  858. make it easier to do a lot  of it.
  859.  
  860. - Jim Luther
  861.  
  862.  
  863. +++++++++++++++++++++++++++
  864.  
  865. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  866. Date: Sun, 18 Sep 1994 22:37:05 +0800
  867. Organization: Department of Computer Science, The University of Western Australia
  868.  
  869. In article <35fe5u$j0m@newsbf01.news.aol.com>, jumplong@aol.com (Jump
  870. Long) wrote:
  871.  
  872. >Writing a foreign file system is by no means simple, but we've tried to
  873. >make it easier to do a lot  of it.
  874.  
  875. So I spent the weekend reading the docs and now I have a question...
  876.  
  877. How do you write an asychronous file system based on a non-block device?
  878. (eg AppleShare)  Presumably you should be using the cache routines because
  879. of this comment...
  880.  
  881. "all calls to most device drivers should be made through the cache routines."
  882.  
  883. (:
  884.  
  885. However the cache routines (eg UTCacheReadIP) seem to imply that they
  886. access the block device driver directly, because they call the
  887. log2PhyProc.  Any ideas?
  888. -- 
  889. Quinn "The Eskimo!"        "Scout in a can. Simple, cheap, easy
  890.                             to use and it's expendable!"
  891.  
  892. +++++++++++++++++++++++++++
  893.  
  894. >From jumplong@aol.com (Jump Long)
  895. Date: 18 Sep 1994 15:43:06 -0400
  896. Organization: America Online, Inc. (1-800-827-6364)
  897.  
  898. In article <quinn-1809942237050001@edu-dynamic5.educ.ecel.uwa.edu.au>,
  899. quinn@cs.uwa.edu.au (Quinn "The Eskimo!") writes:
  900.  
  901. >How do you write an asychronous file system based on a non-block device?
  902. >(eg AppleShare)  Presumably you should be using the cache routines
  903. because
  904. >of this comment...
  905. >
  906. >"all calls to most device drivers should be made through the cache
  907. routines."
  908.  
  909. Here's the answer I gave to a couple of developers during the seed to get
  910. them around this:
  911.  
  912. - ---
  913.  
  914. So, how do you use the cache routines (which are designed to work with
  915. block disk devices) with non-block devices?  You write a very simple block
  916. disk driver - one that supports one writable block.  You'll need a driver
  917. anyway to handle _Control calls with csCode 21 (return physical drive
  918. icon) because the Finder uses that control call.
  919.  
  920. The single block driver is going to be your communications channel between
  921. your FFS, which can only perform block I/O through the cache, and your
  922. non-block driver.  As an example of how this trick works, let's say your
  923. FFS needs to send a command to your WizzyNet driver.
  924.  
  925. First, your FFS needs to get a cache block and associate it with the block
  926. on your simple block driver.  It does this by calling UTGetBlock passing
  927. the volume's volume reference number for the refNum (so the cache code
  928. knows which driver to call), NULL for the log2PhyProc, 0 for the block
  929. number (the only block your driver has), and gbNoRead for the gbOption
  930. (which tells the cache code not to bother reading the block from disk). 
  931. You'll get a pointer back to a 512-byte buffer in the cache.
  932.  
  933. Next, your FFS puts whatever data is wants to send to the block driver (to
  934. send on to the WizzyNet driver) into the cache buffer.  Then, to tell the
  935. cache that the block needs to be sent to the block driver, the FFS calls
  936. UTMarkDirty with the pointer to the cache block. To tell the cache code to
  937. write the block, the FFS calls UTFlushCache.  When the cache code is
  938. called to flush the dirty block to the disk driver, it will call the block
  939. driver to write the cache block.
  940.  
  941. The block driver can then call the WizzyNet driver asynchronously with a
  942. completion routine and then RTS back to the Device Manager.  The Device
  943. Manager will then either return control to the user code or will spin in
  944. the SyncWait loop if the call was made synchronously.
  945.  
  946. When the WizzyNet driver completes the call and the Device Manager calls
  947. the completion routine in the block driver, the block driver will jump to
  948. jIODone, the Device Manager will call the completion routine in the File
  949. Manager's cache code, and the cache code will pass control back through
  950. FSM to the FFS that made the cache call.
  951.  
  952. Finally, when you're done making calls to your driver for this particular
  953. File Manager request, you call UTReleaseBlock to release the block.
  954.  
  955. So, all your block driver needs to handle is _Open, _Close, _Control, and
  956. _Write.  Since it'll never be getting _Read or _Status calls from your
  957. FFS, you can simply return readErr to _Read and statusErr to _Status
  958. requests.  The data your driver is asked to write is going to be the
  959. command or data you want to send to your non-block driver.  You might want
  960. to put a signature long-word in the cache blocks your write so that other
  961. code that mistakenly writes to your driver can be ignored if the signature
  962. isn't there.
  963.  
  964. - ---
  965.  
  966. Yes, that's a hack, but it works and it keeps your foreign file system
  967. from deadlocking the system.  There are a few published foreign file
  968. systems (I won't mention any names) that make synchronous calls to network
  969. drivers which they don't completely own.  Every once in a while, those
  970. file systems deadlock the system because: a) something interrupts while
  971. the driver they call is busy, and b) that code makes an asynchronous File
  972. Manager request and c) if the File Manager isn't busy, it passes the
  973. request on to the foreign file system which d) makes a synchronous call to
  974. the busy driver which causes the system to spin in SyncWait forever (or
  975. until you reset the system or pull the plug).
  976.  
  977. - Jim Luther
  978.  
  979. +++++++++++++++++++++++++++
  980.  
  981. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  982. Date: Mon, 19 Sep 1994 09:42:25 +0800
  983. Organization: Department of Computer Science, The University of Western Australia
  984.  
  985. In article <35i58a$9bi@newsbf01.news.aol.com>, jumplong@aol.com (Jump
  986. Long) wrote:
  987.  
  988. >In article <quinn-1809942237050001@edu-dynamic5.educ.ecel.uwa.edu.au>,
  989. >quinn@cs.uwa.edu.au (Quinn "The Eskimo!") writes:
  990. >
  991. >>How do you write an asychronous file system based on a non-block device?
  992. >
  993. >Yes, that's a hack, but it works [...]
  994.  
  995. Cool.  I figured that the hack would work something like that but it's
  996. nice to know that I'm not missing something obvious.
  997.  
  998. Share and Enjoy.
  999. -- 
  1000. Quinn "The Eskimo!"        "Scout in a can. Simple, cheap, easy
  1001.                             to use and it's expendable!"
  1002.  
  1003. +++++++++++++++++++++++++++
  1004.  
  1005. >From peter.lewis@info.curtin.edu.au (Peter N Lewis)
  1006. Date: Tue, 20 Sep 1994 10:13:20 +0800
  1007. Organization: NCRPDA, Curtin University
  1008.  
  1009. >Cool.  I figured that the hack would work something like that but it's
  1010. >nice to know that I'm not missing something obvious.
  1011.  
  1012. It should be possible to write a generic driver to take the place of that
  1013. block driver, something where the block is formatted like:
  1014.  
  1015. <signature>
  1016. <address to call>
  1017. <generic parameter>
  1018.  
  1019. And have the block driver call the specified address, with a ptr to the
  1020. parameters.  Once we (someone) writes this and makes it available, that
  1021. should be one less chunk we all have to write.  That should work, right?
  1022.    Peter.
  1023. -- 
  1024. Peter N Lewis <peter.lewis@info.curtin.edu.au> - Macintosh TCP fingerpainter
  1025. FTP my programs from redback.cs.uwa.edu.au:Others/PeterLewis/ or
  1026. amug.org:pub/peterlewis/ or nic.switch.ch:software/mac/peterlewis/
  1027.  
  1028. +++++++++++++++++++++++++++
  1029.  
  1030. >From jumplong@aol.com (Jump Long)
  1031. Date: 20 Sep 1994 03:08:06 -0400
  1032. Organization: America Online, Inc. (1-800-827-6364)
  1033.  
  1034. In article <peter.lewis-2009941013200001@rocky.curtin.edu.au>,
  1035. peter.lewis@info.curtin.edu.au (Peter N Lewis) writes:
  1036.  
  1037. >It should be possible to write a generic driver to take the place of
  1038. >that block driver, something where the block is formatted like:
  1039. >
  1040. ><signature>
  1041. ><address to call>
  1042. ><generic parameter>
  1043. >
  1044. >And have the block driver call the specified address, with a ptr to the
  1045. >parameters.  Once we (someone) writes this and makes it available, that
  1046. >should be one less chunk we all have to write.  That should work, right?
  1047.  
  1048. That looks like you're planning on calling <address to call> synchronously
  1049. and that won't work. When the block driver gets a request (either
  1050. asynchronously or synchronously - this method works for both), the block
  1051. driver should:
  1052.  
  1053. 1) Call the network driver asynchronously with a completion routine
  1054. 2) RTS back to the Device Manager
  1055. 3) When the completion routine is executed, jump to ioDone to finish up
  1056. the call.
  1057.  
  1058. The reason it should do it that way is that the network driver could be
  1059. busy. If that's the case, then the request will be queued for execution
  1060. later. The Device Manager will return control to the file system's cache
  1061. code (which called the block driver) and the file system will do one of
  1062. two things: 1) if the original File Manager request was synchronous, it
  1063. will spin in SyncWait until the device request's ioResult field is less
  1064. than or equal to noErr or 2) if the original File Manager request was
  1065. asynchronous, it will return control to the caller.  Either way, when the
  1066. network driver completes its request and the Device Manager calls the
  1067. block driver's completion routine and the block driver calls the File
  1068. Manager's completion routine (or the SyncWait loop code sees ioResult
  1069. change), then control will be returned to the Foreign File System that
  1070. used the cache.
  1071.  
  1072. So, if you're going to write some kind of generic block driver, then you
  1073. should only need to pass it a block with a structure like this:
  1074.  
  1075. enum
  1076. {
  1077.     kReadRequest = 1,
  1078.     kWriteRequest = 2,
  1079.     kControlRequest = 3,
  1080.     kStatusRequest = 4
  1081. };
  1082.  
  1083. struct CallDriverStruct
  1084. {
  1085.     OSType: mySignature; /* the creator type of my foreign file system */
  1086.                          /* to help stop unknown writers */
  1087.     short: callToMake;   /* pass kReadRequest, kWriteRequest, etc. to */
  1088.                          /* tell block driver which driver call to make.
  1089. */
  1090.     ParamBlockRec: pb;   /* parameter block to make driver call with. */
  1091. };
  1092.  
  1093. All of that fits easily into a 512-byte cache block and you don't have to
  1094. worry about the parameter block moving or being reused since cache blocks
  1095. you get with UTGetBlock are yours until you release them (and they don't
  1096. move in memory - ever).
  1097.  
  1098. All of this is off the top of my somewhat sleepy head, so I hope it makes
  1099. sense. If you get something working and want a code review, let me know.
  1100. If I have time, I'll write it...
  1101.  
  1102. - Jim Luther
  1103.  
  1104.  
  1105. +++++++++++++++++++++++++++
  1106.  
  1107. >From benh@fdn.org (Benjamin Herrenschmidt)
  1108. Date: Wed, 21 Sep 94 23:00:53 +0100
  1109. Organization: (none)
  1110.  
  1111. Hi !
  1112.  
  1113. I was away from the usenet for some days (AppleExpo in Paris) and
  1114. i missed the beginning of this thread. The API to the File System
  1115. Manager is available somewhere ? I am interested....
  1116.  
  1117. BenH.
  1118.  
  1119. ---------------------------
  1120.  
  1121. >From gwatts@whcdfo.fnal.gov
  1122. Subject: GDGX Graphics Shell bus errors with GX Beta 3...
  1123. Date: 19 Sep 94 09:17:28 -0600
  1124. Organization: Fermi National Accelerator Lab
  1125.  
  1126. Hi all,
  1127.   I'm trying to teach myself some QDGX graphics this week. :)
  1128.   Short story is I built GDGX Graphics Shell with MW and I get a trashed
  1129. stack ("sc" in Macsbug says my stack pointer is odd!).  The precompiled version
  1130. on the develop CD bombs with a bus error as well.  Details next:
  1131.   I thought I would start by building the QDGX Graphics shell from Develop 15.
  1132. I pulled the source code from develop 19, and I'm using beta 3 of GX (I don't 
  1133. system 7.5 yet, just 7.1).  The app on the disk crashed my mac with a bus error.
  1134. So, I decided to recompile everything.
  1135.   I'm using MW D/4.  First thing I have to do is #define ppcinterfaces in all
  1136. the source files (including the library files!).  Second, the shell sources
  1137. won't compile as is.  There is a routine GXQDGlobalToFixedLocal, for example,
  1138. that doesn't exist in any of the gx .h files.  I replaced it with
  1139. ConvertGXPoint, and used the parent view port of gcontentWindow to get the
  1140. local coords correct.  When creating the "runFeatures" for the styled layout
  1141. shape, the second feather (alternateblahblah) doesn't exist in gx anylonger.
  1142. Is that right?  For the time being, I've just removed it.
  1143.   So, what did I miss.  Do I have to do a #pramga parameters_in_a0 or something
  1144. like that around the gx interfaces?  Why isn't this done automagically, if I
  1145. do have to do it.
  1146.   I only just started last night, so I've not done a detailed step through
  1147. the program yet.  I just figured that others starting out with GX may have
  1148. seen the same thing, and save me some time.  Thought changing the to the
  1149. ConvertQDPoint taught me a bit about viewport coord systems!
  1150.   Any help would be great!  TIA.
  1151.  
  1152.     Cheers,
  1153.         Gordon.
  1154.  
  1155. +++++++++++++++++++++++++++
  1156.  
  1157. >From dkj@apple.com (Dave Johnson)
  1158. Date: Wed, 21 Sep 1994 17:56:24 GMT
  1159. Organization: Apple Computer
  1160.  
  1161. In article <1994Sep19.091728.1@whcdfo.fnal.gov>, gwatts@whcdfo.fnal.gov wrote:
  1162.  
  1163. >   I thought I would start by building the QDGX Graphics shell from Develop 15.
  1164. > I pulled the source code from develop 19, and I'm using beta 3 of GX (I don't 
  1165. > system 7.5 yet, just 7.1).  The app on the disk crashed my mac with a
  1166. bus error.
  1167.  
  1168. The QDGX Shell on the CDs was compiled for, and runs under, beta 1 of GX
  1169. (and without universal interfaces). It was never updated for beta 3,
  1170. unfortunately. The quick and (very) dirty way to get it up and running
  1171. would be to install beta 1 (it's on the issue 15 CD) and use old headers.
  1172. Not recommended.
  1173.  
  1174. > So, I decided to recompile everything.
  1175. >   I'm using MW D/4.  First thing I have to do is #define ppcinterfaces in all
  1176. > the source files (including the library files!).
  1177.  
  1178. It actually might be better to #define it in either a "prefix" file (if
  1179. you're not using precompiled headers) or in a .h file that you include
  1180. before any other headers.
  1181.  
  1182. > Second, the shell sources
  1183. > won't compile as is.  There is a routine GXQDGlobalToFixedLocal, for example,
  1184. > that doesn't exist in any of the gx .h files.  I replaced it with
  1185. > ConvertGXPoint, and used the parent view port of gcontentWindow to get the
  1186. > local coords correct.
  1187.  
  1188. Excellent exercise! :-) That routine went away between beta 1 and beta 3.
  1189.  
  1190. >   So, what did I miss.  Do I have to do a #pramga parameters_in_a0 or
  1191. something
  1192. > like that around the gx interfaces?
  1193.  
  1194. Here's the recommended "prefix" file for MW, most of which came from the GX SDK:
  1195.  
  1196. ///
  1197.  
  1198. #define ppcinterfaces
  1199.  
  1200. #ifndef powerc
  1201.    // The following two typedef's are to work around a bug in the ETO #15
  1202.    // Universal headers -- the headers only typedef float_t and double_t
  1203.    // for "applec" and "powerc".  When this is eventually fixed, these
  1204.    // lines will generate "redefined type" errors.
  1205.  
  1206.    typedef long double float_t;
  1207.    typedef long double double_t;
  1208.  
  1209.    // The following is required if using Metrowerks 68K (CW4).
  1210.    // Otherwise, MetroWerks 68K expects (and uses what it thinks are)
  1211.    // A0 result values instead of D0 ones.
  1212.  
  1213.    #pragma pointers_in_D0     // Required for c-style toolbox glue.
  1214. #endif
  1215.  
  1216. ///
  1217.  
  1218. On the November CDs (Bookmark 20 and Reference Library), the beta 1 GX
  1219. shell will probably be replaced with the "modern" version that comes with
  1220. the SDK (I still have to get buyoff for that, but I don't anticipate any
  1221. problems). It uses the release version of GX, and the code has been
  1222. cleaned up in a big way. Frankly I wouldn't recommend the old one any
  1223. more, except as an "exercise for the reader."
  1224.  
  1225. Have fun!
  1226.  
  1227. Dave Johnson
  1228. Technical Buckstopper
  1229. d e v e l o p
  1230.  
  1231. +++++++++++++++++++++++++++
  1232.  
  1233. >From lalonde@metrowerks.ca (Paul Lalonde)
  1234. Date: Thu, 22 Sep 1994 11:24:47 GMT
  1235. Organization: Metrowerks
  1236.  
  1237. In article <1994Sep19.091728.1@whcdfo.fnal.gov>, gwatts@whcdfo.fnal.gov wrote:
  1238.  
  1239. > Hi all,
  1240. >   I'm trying to teach myself some QDGX graphics this week. :)
  1241. >   Short story is I built GDGX Graphics Shell with MW and I get a trashed
  1242. > stack ("sc" in Macsbug says my stack pointer is odd!).  The precompiled
  1243. version
  1244. > on the develop CD bombs with a bus error as well.  Details next:
  1245. >   I thought I would start by building the QDGX Graphics shell from Develop 15.
  1246. > I pulled the source code from develop 19, and I'm using beta 3 of GX (I don't 
  1247. > system 7.5 yet, just 7.1).  The app on the disk crashed my mac with a
  1248. bus error.
  1249. > So, I decided to recompile everything.
  1250. >   I'm using MW D/4.  First thing I have to do is #define ppcinterfaces in all
  1251. > the source files (including the library files!).  Second, the shell sources
  1252. > won't compile as is.  There is a routine GXQDGlobalToFixedLocal, for example,
  1253. > that doesn't exist in any of the gx .h files.  I replaced it with
  1254. > ConvertGXPoint, and used the parent view port of gcontentWindow to get the
  1255. > local coords correct.  When creating the "runFeatures" for the styled layout
  1256. > shape, the second feather (alternateblahblah) doesn't exist in gx anylonger.
  1257. > Is that right?  For the time being, I've just removed it.
  1258. >   So, what did I miss.  Do I have to do a #pramga parameters_in_a0 or
  1259. something
  1260. > like that around the gx interfaces?  Why isn't this done automagically, if I
  1261. > do have to do it.
  1262. >   I only just started last night, so I've not done a detailed step through
  1263. > the program yet.  I just figured that others starting out with GX may have
  1264. > seen the same thing, and save me some time.  Thought changing the to the
  1265. > ConvertQDPoint taught me a bit about viewport coord systems!
  1266. >   Any help would be great!  TIA.
  1267. >         Cheers,
  1268. >                 Gordon.
  1269.  
  1270. I've been through this problem, and what I did was make myself a precompiled 
  1271. header whose source file included all of the GX headers.  Everything was then 
  1272. wrapped between #pragma parameters_in_d0 and #pragma parameters_in_a0.  Then 
  1273. things started working :)
  1274.  
  1275. You see, contrary to almost the whole Toolbox, the GX graphics routines use 
  1276. the C calling convention.  Problem is, those conventions vary from one compiler 
  1277. to the next.  Hence the need for the #pragma.
  1278.  
  1279. Also, if you're looking for those missing " alternateblahblah" declarations, 
  1280. there's a demo on the develop 17 CD (*not* called "QDGX Graphics shell", 
  1281. though) that puts up the same graphic as the shell on the develop 15 CD, 
  1282. so you can just cut and paste.
  1283.  
  1284. Note:  The headers changed between B1 and B3.  Be sure you're using the right 
  1285. headers for the version you're running.
  1286.  
  1287.  
  1288. Paul Lalonde
  1289. lalonde@metrowerks.ca
  1290.  
  1291. ---------------------------
  1292.  
  1293. >From stone@phoenix.cs.uga.edu (Robert)
  1294. Subject: Getting Started (Summary)
  1295. Date: 17 Sep 1994 23:45:40 GMT
  1296. Organization: kind of sloppy actually....
  1297.  
  1298. Thanks to everyone who sent responses to me.  Here's a compilation of some of
  1299. what I got when I asked about getting started with Macintosh programming for
  1300. around $200.  Hopefully this will prove helpful to others out there who are
  1301. toying with the idea of attempting to learn Mac programming.
  1302.  
  1303.  
  1304. >From Gary M. Greenberg <garyg@UFCC.UFL.EDU>
  1305.  
  1306. Part of what you do should depend on how much _other_ programming
  1307. background you have. Many newbies to the Mac are highly or fairly
  1308. experienced on other platforms. If that's you, then get the biggest,
  1309. baddest, _mostest_ package you can find (maybe even get SC++7.__ and CW
  1310. Gold).
  1311.  
  1312. On the other hand, if you're like me and you have no (zero) former
  1313. programming experience, _and_ you're teaching yourself rather than studying
  1314. CS at a university, then any ANSI C compiler and good books will be fine.
  1315.  
  1316. I've been teaching myself how to code for a few months but I've only had a
  1317. few actual weeks of time to spend working at it. Still, I've gotten through
  1318. 7 chapters of the Waite Group's C Primer Plus, and I'm concurrently reading
  1319. K&R's The C Programming Language, 2nd Edition. I'm also chipping away at a
  1320. new book called Symantec C++ Programming for the Macintosh (with Diskette
  1321. for about $35.00). I bought SC++6.0 for $50.00 and got the free upgrades
  1322. from the SC FTP site. I'm sure that the OO Libraries are about 6-12 months
  1323. beyond my reach given the limited time I can invest in learning right now,
  1324. but I expect a geometric progression -- you should too.
  1325.  
  1326. I've spent more on books than any other resource. The books on CD are okay
  1327. if that is all money will permit, but you'll become hungry for the paper
  1328. soon, as too much screen time weakens one's concentration. I've used them
  1329. enough to know. And, I now subscribe to MacTech and Develop. I've written
  1330. some very small _useless_ programs/exercises (and had fun each minute
  1331. making them work) so my method is having a positive result. Books, source
  1332. code, following c.s.m.p. and a.s.m. (that's alt.sources.mac) and lots of
  1333. keystrokin' is what will bring it all together for you and the tool you
  1334. choose (the brand of programming environment) will be less important.
  1335. You'll see lots of passionate hooey about all the brands. Each has lovers
  1336. and haters (I personally can't wait til my skills become sharp enough that
  1337. I feel comfortable tackling Smalltalk) but they are only _tools_.
  1338.  
  1339. I firmly believe that after you are successful at learning a language,
  1340. you'll move around and experiment with many different types of tools. So,
  1341. $200 [hey, I made it back to your topic ;-) ] is a comfortable starting
  1342. point ...
  1343. yet, it's just that ... a starting point.
  1344.  
  1345.  
  1346. >From Tim Dixon  <tdixon@css.tayloru.edu>
  1347.  
  1348. If you're a student (or perhaps faculty, I don't know) CodeWarrior Gold is
  1349. available at the educational price of $99.  Call 1-800-377-5416 for details.
  1350.  
  1351. [Regarding having a friend who's a student order for you:]
  1352.  
  1353. That should work.  A friend and I placed our orders at the same time.  We
  1354. had to place separate orders, but they let us both use his credit card (I
  1355. don't have one so I paid him by check).  They'll also accept a check.
  1356.  
  1357.  
  1358. >From Peter S. Lau:
  1359.  
  1360. well, CodeWarrier is quiet good, and you can tell by the recent
  1361. created and active newsgroup comp.sys.mac.programmer.codewarrier.  I
  1362. think $99 to get the compiler (actually 3 compilers C, C++, and
  1363. Pascal), plus tools, plus class library is definitely a bargain.  I
  1364. have used the demo version in Thomson's book.  I feel quiet
  1365. comfortable with it.
  1366.  
  1367. A few third-party books are good, too.  "Macintosh Programming Secrets" 2nd
  1368. edition is good.  I found it a bit wordy, but the examples are practical, so
  1369. that's the good part.  You might want to check the library.
  1370.  
  1371.  
  1372. >From Robert B. Schmunk <pcrxs@nasagiss.giss.nasa.gov>
  1373.  
  1374. The develop Bookmark CD no longer contains all the NIM books, but if you
  1375. request a copy of issue #17 (backissues cost about $10), I understand that
  1376. all that had been released before spring 1994 they're all on that one. To
  1377. get the newer ones, you'll need to subscribe, which is something like $37
  1378. for four issues. Supposedly, Addison-Wesley will be publishing a CD sometime
  1379. in the next couple months which contains nothing but a complete NIM (the
  1380. Bookmark CD contains lots more), and the street price will supposedly be
  1381. around $99.
  1382.  
  1383.  
  1384. >From Eric Drumbor <ericd@netcom.com>
  1385.  
  1386.      I would check around for used books.  I purchased volumes 1-6, the 
  1387. X-Reference, and a book on the Communications Toolbox (this was all from 
  1388. the old series) for $30.  The CDs are nice to have, but it's much easier 
  1389. to have a book to use as a reference.
  1390.  
  1391.      I don't know what you have as far as beginners programming books (if 
  1392. you actually need them), but I would recommend either Learn C on the 
  1393. Macintosh and The C Programming Primer from Dave Mark, or Think THINK C 
  1394. by Dan Parks Sydow (Sydow has also written another "intermediate" book 
  1395. that explains more about the Macintosh Toolbox commands).  Mark's books 
  1396. are fairly good, but I think Sydow has a better understanding on how to 
  1397. teach and what needs to be explained.
  1398.  
  1399.      What I've suggested goes over the $200 mark, but I'd recommend that 
  1400. you get Code Warrior and some kind of C book before you get a Develop 
  1401. subscription.  I've spent over $600 in books alone, and I'm still waiting 
  1402. for my next paycheck to buy some more.  Hope this helps..good luck!
  1403.  
  1404.  
  1405.  
  1406. @@@@@ Robert Stone (stone@phoenix.cs.uga.edu)
  1407. @@@@@ Some Sort of Computer-Related Person, UGA - Extension Dairy Sci.
  1408. @@@@@ I am not responsible for anything I might say.
  1409.  
  1410.  
  1411. +++++++++++++++++++++++++++
  1412.  
  1413. >From kenlong@netcom.com (Ken Long)
  1414. Date: Mon, 19 Sep 1994 04:04:17 GMT
  1415. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  1416.  
  1417. If someone wanted to program on the Mac and had minimal finances, and 
  1418. could only afford a used Think C package, then what could they get to 
  1419. learn more?
  1420.  
  1421. Kernighan on C - a big text (w.p.) document by Brian Kernigan on the C 
  1422. language, SpInside Mac, and as much example source as could be found and 
  1423. downloaded.  The books are all expensive and many only give you example 
  1424. code and a book full of comments.  Some have useful info not found in 
  1425. example code, but is it absolutely necessary for the price?
  1426.  
  1427. I've found few source examples in books (or on the extra disks you'd buy) 
  1428. that did not have similar or identical example sources somewhere in 
  1429. cyberspace.  And there are a LOT more examples in cyberspace that you'd 
  1430. not see in any bought book.
  1431.  
  1432. I'm not against buying programming books - especially IM.  I've got 
  1433. plenty of money tied up in them!  But if you don't have any money, 
  1434. example source and SpInside Mac is your route.  As far as value in 
  1435. programmer training, I'd say IM, example source and programmer message 
  1436. forums are far superior than Mac programming books.  Think C 5's Standard 
  1437. Libraries manual was a real close second to K&R's.
  1438.  
  1439. -Ken-
  1440.  
  1441. +++++++++++++++++++++++++++
  1442.  
  1443. >From Clay Thurmond <claytex@panix.com>
  1444. Date: 19 Sep 1994 04:45:00 GMT
  1445. Organization: TVMHS
  1446.  
  1447. In article <kenlongCwCzB5.Bsz@netcom.com> Ken Long, kenlong@netcom.com
  1448. writes:
  1449. >Kernighan on C - a big text (w.p.) document by Brian Kernigan on the C 
  1450. >language, SpInside Mac, and as much example source as could be found and 
  1451. >downloaded.  The books are all expensive and many only give you example 
  1452. >code and a book full of comments.  Some have useful info not found in 
  1453. >example code, but is it absolutely necessary for the price?
  1454.  
  1455. I've heard of this Spinside Mac a number of times, but I've never been
  1456. able to find it.  Archie comes up dry.  I haven't been able to locate it
  1457. on ftp.apple.com either.  Any idea where it is exactly?  Also, is this
  1458. Kernighan document available on the net?
  1459.  
  1460. Thanks,
  1461. Clay
  1462.  
  1463. +++++++++++++++++++++++++++
  1464.  
  1465. >From jwbaxter@olympus.net (John W. Baxter)
  1466. Date: Mon, 19 Sep 1994 12:05:37 -0700
  1467. Organization: Internet for the Olympic Peninsula
  1468.  
  1469. In article <35j50c$o1v@news.panix.com>, Clay Thurmond <claytex@panix.com> wrote:
  1470.  
  1471. > In article <kenlongCwCzB5.Bsz@netcom.com> Ken Long, kenlong@netcom.com
  1472. > writes:
  1473. > >Kernighan on C - a big text (w.p.) document by Brian Kernigan on the C 
  1474. > >language, SpInside Mac, and as much example source as could be found and 
  1475. > >downloaded.  The books are all expensive and many only give you example 
  1476. > >code and a book full of comments.  Some have useful info not found in 
  1477. > >example code, but is it absolutely necessary for the price?
  1478. > I've heard of this Spinside Mac a number of times, but I've never been
  1479. > able to find it.
  1480.  
  1481. SpInside Mac is a monster Hypercard stack (with bunches of supporting
  1482. files).  That in itself isn't so bad, but...SpInside Mac is also very
  1483. obsolete (roughly speaking, it is part way between volumes I through V and
  1484. volume VI, with some extras).
  1485.  
  1486. I've ignored it on the last couple of years of CDs it has come on, and
  1487. never looked for it on the net.  --John
  1488.  
  1489. -- 
  1490. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1491.    "Occasionally...astronomers add a second to either June 31 or
  1492.     December 31..."   IM: OS Utilities, p 4-12
  1493.    jwbaxter@pt.olympus.net
  1494.  
  1495. +++++++++++++++++++++++++++
  1496.  
  1497. >From d_spacey@icrf.icnet.uk (Dylan the Hippy Wabbit)
  1498. Date: Wed, 21 Sep 1994 15:31:11 -0500
  1499. Organization: Imperial Cancer Research Fund
  1500.  
  1501. In article <35j50c$o1v@news.panix.com>, Clay Thurmond <claytex@panix.com>
  1502. wrote:
  1503.  
  1504.  
  1505. > I've heard of this Spinside Mac a number of times, but I've never been
  1506. > able to find it.  Archie comes up dry.  I haven't been able to locate it
  1507. > on ftp.apple.com either.  Any idea where it is exactly?  Also, is this
  1508. > Kernighan document available on the net?
  1509. > Thanks,
  1510. > Clay
  1511.  
  1512. Ftp to ftp.apple.com, I'm afraid I don't remember the directory name. 
  1513. Alternatively use http://dts.apple.com if you have a web browser.  Either
  1514. way be warned about the time/disk space requirements.  There are eight
  1515. parts taking up 7 1/2 meg.  Being multipart you will need unstuffit rather
  1516. than stuffit expander.
  1517.  
  1518. Once you've got it you'll find it's like learning a language from a
  1519. French/English dictionary.  I've been scratching my head over the thing all
  1520. year.
  1521.  
  1522. Dave Spacey
  1523.  
  1524. -- 
  1525. Don't underestimate the abacus......it requires no power, can be made with
  1526. any materials you have to hand, and never goes bing in the middle of an
  1527. important piece of work.   (Many thanks to Douglas Adams.)
  1528.  
  1529. +++++++++++++++++++++++++++
  1530.  
  1531. >From s.fraser@ic.ac.uk (Simon Fraser)
  1532. Date: Wed, 21 Sep 94 19:52:09 BST
  1533. Organization: Centre for Population Biology, Imperial College, UK.
  1534.  
  1535. In article <35j50c$o1v@news.panix.com> Clay Thurmond, claytex@panix.com
  1536. writes:
  1537. >I've heard of this Spinside Mac a number of times, but I've never been
  1538. >able to find it.  Archie comes up dry.  I haven't been able to locate it
  1539. >on ftp.apple.com either.  Any idea where it is exactly?  Also, is this
  1540.  
  1541. OK, here it is!
  1542.  
  1543. ftp.apple.com:dts/mac/docs/stacks/spinside/spinside-mac-4-0-2-pt1.hqx
  1544. ftp.apple.com:dts/mac/docs/stacks/spinside/spinside-mac-4-0-2-pt2.hqx
  1545. ftp.apple.com:dts/mac/docs/stacks/spinside/spinside-mac-4-0-2-pt3.hqx
  1546. ftp.apple.com:dts/mac/docs/stacks/spinside/spinside-mac-4-0-2-pt4.hqx
  1547. ftp.apple.com:dts/mac/docs/stacks/spinside/spinside-mac-4-0-2-pt5.hqx
  1548. ftp.apple.com:dts/mac/docs/stacks/spinside/spinside-mac-4-0-2-pt6.hqx
  1549. ftp.apple.com:dts/mac/docs/stacks/spinside/spinside-mac-4-0-2-pt7.hqx
  1550.  
  1551. The whole lot uncompresses into a 10.8Mb folder.
  1552. I find it really useful (well, more so before I started to buy the
  1553. new Inside Macintosh books (you'll see them referred to as NIM: Text
  1554. for example).
  1555. Stretching out the Hypercard stack to the height of a 14" monitor
  1556. makes it a lot easier as well. I did this by a combination of
  1557. 'set the userlevel to 5' in the message box, and having a new, 
  1558. unprotected stack open at the same time, which enabled me to get
  1559. at the tool palette.
  1560.  
  1561. You might also find the technotes stack useful-- 5.9 Mb worth!
  1562.  
  1563. ftp.apple.com:dts/mac/docs/stacks/tnstack/tech-notes-stack-4-0-4-pt1.hqx
  1564. ftp.apple.com:dts/mac/docs/stacks/tnstack/tech-notes-stack-4-0-4-pt2.hqx
  1565. ftp.apple.com:dts/mac/docs/stacks/tnstack/tech-notes-stack-4-0-4-pt3.hqx
  1566. ftp.apple.com:dts/mac/docs/stacks/tnstack/tech-notes-stack-4-0-4-pt4.hqx
  1567. ftp.apple.com:dts/mac/docs/stacks/tnstack/tech-notes-stack-4-0-4-pt5.hqx
  1568.  
  1569. Hope this helps!
  1570.  
  1571. Simon
  1572. P.S. the best time to access files of this size of off-peak at a weekend.
  1573. It's dead fast early on a Sunday morning from the UK!
  1574. __________________________________________________________________________
  1575. Simon Fraser                            NERC Centre for Population Biology
  1576. s.fraser@ic.ac.uk                         Imperial College at Silwood Park
  1577.                                              Ascot, Berkshire, SL5 7PY. UK
  1578.  
  1579. ---------------------------
  1580.  
  1581. >From beltoft@icaen.uiowa.edu (Brian S Eltoft)
  1582. Subject: Help: idle, shutdown, and MacTCP examples..
  1583. Date: 19 Sep 1994 13:31:21 GMT
  1584. Organization: Iowa Computer Aided Engineering Network
  1585.  
  1586.  
  1587. I'm looking for source code that shows how you would write a program to 
  1588. sense that the mac has been idle for sometime... as well as an example 
  1589. of a safe shutdown (as if I'm using the shutdown from the special menu).
  1590. I tried the example found in Inside Mac, but it gives me an error of 
  1591. -609 when I try the AESend(..)  I was also looking about for some examples
  1592. of MacTCP...  something that would do a finger...
  1593.  
  1594. If anyone has any info on where to look for this code could you please mail
  1595. it to: beltoft@icaen.uiowa.edu
  1596.  
  1597. -- 
  1598. Brian Eltoft   
  1599. Email:  beltoft@icaen.uiowa.edu
  1600.  
  1601. +++++++++++++++++++++++++++
  1602.  
  1603. >From brook@psy.uwa.edu.au (Brook )
  1604. Date: 19 Sep 1994 23:28:43 GMT
  1605. Organization: The University of Western Australia
  1606.  
  1607. beltoft@icaen.uiowa.edu (Brian S Eltoft) writes:
  1608.  
  1609.  
  1610. >I'm looking for source code that shows how you would write a program to 
  1611. >sense that the mac has been idle for sometime... as well as an example 
  1612. >of a safe shutdown (as if I'm using the shutdown from the special menu).
  1613. >I tried the example found in Inside Mac, but it gives me an error of 
  1614. >-609 when I try the AESend(..)  I was also looking about for some examples
  1615. >of MacTCP...  something that would do a finger...
  1616.  
  1617.  The following function is a correction to the one shown in IM:Processes
  1618. and works for me.                             
  1619. FUNCTION ShutDownSafely : OSErr
  1620. CONST
  1621.     kFinderSig = 'MACS'
  1622. VAR
  1623.     myErr:        OSErr;
  1624.     finderAddr:    AEDesc;
  1625.     myShutDown:    AppleEvent;
  1626.     nilReply:        AppleEvent;
  1627.     signature:    OSType;
  1628. BEGIN
  1629.     signature := kFinderSig;
  1630.     myErr := AECreateDesc ( typeApplSignature,
  1631.                             @signature,SizeOf(OSType),
  1632.                             finderAddr);
  1633.     IF myErr = noErr THEN
  1634.         myErr := AECreateAppleEvent ( kAEFinderEvents,
  1635.                     kAEShutDown,finderAddr,
  1636.                     kAutoGenerateReturnID,
  1637.                     AnyTransactionID,myShutDown);
  1638.     IF myErr = noErr THEN
  1639.         myErr := AESend ( myShutDown,nilReply,
  1640.                     kAENoreply + kAECanSwitchLayer
  1641.                     + kAEAlwaysInteract,
  1642.                     kAENormalPriority,
  1643.                     kAEDefaultTimeOut,nil,nil);
  1644.     ShutDownSafely := myErr;
  1645. END;
  1646.  
  1647. --
  1648. Brooklyn Waters (Senior Programmer)    email: brook@psy.uwa.edu.au
  1649. Centre for Computer Managed Training and Decision Support Systems
  1650. The University of Western Australia    Tel: +61-9-3803637
  1651. NEDLANDS WA 6009   AUSTRALIA           FAX: +61-9-3801006
  1652.  
  1653. +++++++++++++++++++++++++++
  1654.  
  1655. >From David_Seale@magic.ca (David Seale)
  1656. Date: 21 Sep 1994 22:08:32 GMT
  1657. Organization: Magic Online Services Toronto Inc.
  1658.  
  1659. "I'm looking for source code that shows how you would write a program to 
  1660. sense that the mac has been idle for sometime... as well as an example 
  1661. of a safe shutdown (as if I'm using the shutdown from the special menu).
  1662. I tried the example found in Inside Mac, but it gives me an error of 
  1663. -609 when I try the AESend(..)"
  1664.  
  1665. I seem to remember that the -609 error is because the example in IM:Processes
  1666. is wrong.
  1667. I think that the solution is to change the Finder signature to 'MACS',
  1668. instead of 'FNDR' or whatever they have.
  1669. If that doesn't work, use the process manager to look for the Finder, and
  1670. then use the ProcessSerialNumber version of the AE (That's what I did).
  1671.  
  1672. The idle thing is not as hard as it sounds. I used a timer task to check to
  1673. see if any of the keys were down on the keyboard (using GetKeys), and if the
  1674. mouse was still in the same position, works very well.
  1675.  
  1676. Hope this is helpful (and that I'm not confused again).
  1677.  
  1678. Dave.
  1679. david_seale@magic.ca
  1680.  
  1681.  
  1682. ---------------------------
  1683.  
  1684. >From fehrst@herald.usask.ca (Stuart Fehr)
  1685. Subject: Pascal Flavours for Macintosh
  1686. Date: 19 Sep 1994 19:16:07 GMT
  1687. Organization: University of Saskatchewan
  1688.  
  1689. Our campus bookstore sells two Pascal for Macintosh software packages.  
  1690. They are:  Think Pascal by Symantec, and Pascal for the Macintosh, also 
  1691. by Symantec.
  1692.  
  1693. What are the differences?  Or, maybe I should ask, what is Pascal for the 
  1694. Macintosh?  I haven't read or heard anything about it at all.  I have 
  1695. been reading the posts on Think Pascal, but have seen no mention of this 
  1696. other one.
  1697.  
  1698. There is a significant price difference too -- Pascal for the Macintosh 
  1699. is approx. $20.00 more than think Pascal.
  1700.  
  1701. Any suggestions or information would be appreciated.
  1702.  
  1703. +++++++++++++++++++++++++++
  1704.  
  1705. >From peter.lewis@info.curtin.edu.au (Peter N Lewis)
  1706. Date: Wed, 21 Sep 1994 10:40:25 +0800
  1707. Organization: NCRPDA, Curtin University
  1708.  
  1709. In article <35ko1n$5b8@tribune.usask.ca>, fehrst@herald.usask.ca (Stuart
  1710. Fehr) wrote:
  1711.  
  1712. >Our campus bookstore sells two Pascal for Macintosh software packages.  
  1713. >They are:  Think Pascal by Symantec, and Pascal for the Macintosh, also 
  1714. >by Symantec.
  1715.  
  1716. No idea.  Symantec used to (and may still do) sell a Juse Enough Pascal
  1717. which was a education tool or something, I'm not sure.
  1718.  
  1719. Pascal Compilers:
  1720.  
  1721. THINK Pascal 4.0.2
  1722. Object Pascal.  68k only.  Very nice environment.  Basically bug free, but
  1723. the program is dead (it will likely never be updated) and is growing
  1724. incompatiblities with each new system version.
  1725.  
  1726. Metrowerks CodeWarrior Pascal
  1727. No Objects (scheduled for the end of the year).  Native & 68k, both are
  1728. still in development and are not bug free.  Quite nice environment, also
  1729. still in development.  Not quite production quality as yet, but this
  1730. program is getting being worked on full time by Metrowerks, and will
  1731. almost certainly be the Pascal compiler to choose after the end of the
  1732. year.
  1733.  
  1734. Language Systems Pascal
  1735. Object Pascal.  Native (& 68k?).  Still in beta, I dont know how solid it
  1736. is.  MPW evironment only, so not really suitable for education/lab use if
  1737. you want a friendly environment.
  1738.  
  1739. MPW Pascal
  1740. Object Pascal.  68K only.  Free from serious bugs.  Doesn't cut it for a
  1741. standalone project when compared to Think Pascal but useful when you need
  1742. to build something strange (INITs, DRVRs, etc).
  1743.  
  1744. Enjoy,
  1745.    Peter.
  1746. -- 
  1747. Peter N Lewis <peter.lewis@info.curtin.edu.au> - Macintosh TCP fingerpainter
  1748. FTP my programs from redback.cs.uwa.edu.au:Others/PeterLewis/ or
  1749. amug.org:pub/peterlewis/ or nic.switch.ch:software/mac/peterlewis/
  1750.  
  1751. ---------------------------
  1752.  
  1753. >From bb@lightside.com (Bob Bradley)
  1754. Subject: Q: Script-Independant Command-Keys?
  1755. Date: Sun, 18 Sep 1994 10:54:40 -0800
  1756. Organization: SS Software Inc.
  1757.  
  1758. I have a simple dialog for "Don't Save, "Cancel", "Save" and want to
  1759. handle commands keys for the dialog correctly. Right now, I'm just
  1760. checking for 'D', Escape or Command Period (I am doing international
  1761. canceling), and Return or Enter, respectively but, I know there's a better
  1762. way.
  1763.  
  1764. I'd like to make the code localizable and to also get rid of data (the raw
  1765. 'D' letter, etc..) from the source code (so I don't have t re-compile to
  1766. change it).
  1767.  
  1768. How would I go about this? I assume it would all be thru the use of the
  1769. Script Manager but, I'm not sure on the implementation.
  1770.  
  1771. +++++++++++++++++++++++++++
  1772.  
  1773. >From resnick@uiuc.edu (Pete Resnick)
  1774. Date: Mon, 19 Sep 1994 23:38:05 -0500
  1775. Organization: University of Illinois at Urbana-Champaign
  1776.  
  1777. In article <bb-1809941054400001@user53.lightside.com>, bb@lightside.com
  1778. (Bob Bradley) wrote:
  1779.  
  1780. > I have a simple dialog for "Don't Save, "Cancel", "Save" and want to
  1781. > handle commands keys for the dialog correctly. Right now, I'm just
  1782. > checking for 'D', Escape or Command Period (I am doing international
  1783. > canceling), and Return or Enter, respectively but, I know there's a better
  1784. > way.
  1785. > I'd like to make the code localizable and to also get rid of data (the raw
  1786. > 'D' letter, etc..) from the source code (so I don't have t re-compile to
  1787. > change it).
  1788. > How would I go about this? I assume it would all be thru the use of the
  1789. > Script Manager but, I'm not sure on the implementation.
  1790.  
  1791. For single-byte languages, this is easy: Just do a GetControlTitle() for
  1792. each of the controls in the dialog (doing a GetDialogItem() to get the
  1793. control handles) and then compare the keystroke with the first character
  1794. of the control title. Use the same method you do for command-period to
  1795. make sure that you get the correct ASCII character code, and then make
  1796. sure to use the CompareText() or IdenticalText() routines so that case and
  1797. diacriticals are handled properly.
  1798.  
  1799. For double-byte languages, you're going to have a problem since the
  1800. character codes for a single character are going to come through in two
  1801. events. In this case, you could get really cute and force the keyboard to
  1802. something that will produce single-bytes only (like Romanji in Japanese)
  1803. and then Transliterate() the names of the buttons and compare the first
  1804. character, but I think this gets a little absurd. Personally, if the
  1805. current font for the buttons (i.e. the system font or the window font of
  1806. your dialog if the buttons are useWFont) is a double-byte character font,
  1807. I would punt on the "command key for the first letter of the button"
  1808. method.
  1809.  
  1810. pr
  1811. -- 
  1812. Pete Resnick    (...so what is a mojo, and why would one be rising?)
  1813. Doctoral Student - Philosophy Department, Gregory Hall, UIUC
  1814. System manager - Cognitive Science Group, Beckman Institute, UIUC
  1815. Internet: resnick@uiuc.edu
  1816.  
  1817. +++++++++++++++++++++++++++
  1818.  
  1819. >From bb@lightside.com (Bob Bradley)
  1820. Date: Sun, 18 Sep 1994 14:19:30 -0800
  1821. Organization: SS Software Inc.
  1822.  
  1823. In article <resnick-1909942338050001@resnick1.isdn.uiuc.edu>,
  1824. resnick@uiuc.edu (Pete Resnick) wrote:
  1825.  
  1826. > For single-byte languages, this is easy: Just do a GetControlTitle() for
  1827. > each of the controls in the dialog (doing a GetDialogItem() to get the
  1828. > control handles) and then compare the keystroke with the first character
  1829. > of the control title. Use the same method you do for command-period to
  1830. > make sure that you get the correct ASCII character code, and then make
  1831. > sure to use the CompareText() or IdenticalText() routines so that case and
  1832. > diacriticals are handled properly.
  1833. > For double-byte languages, you're going to have a problem since the
  1834. > character codes for a single character are going to come through in two
  1835. > events. In this case, you could get really cute and force the keyboard to
  1836. > something that will produce single-bytes only (like Romanji in Japanese)
  1837. > and then Transliterate() the names of the buttons and compare the first
  1838. > character, but I think this gets a little absurd. Personally, if the
  1839. > current font for the buttons (i.e. the system font or the window font of
  1840. > your dialog if the buttons are useWFont) is a double-byte character font,
  1841. > I would punt on the "command key for the first letter of the button"
  1842. > method.
  1843.  
  1844. I'd like to figure out a good method for storing the command-keys in a
  1845. resource which I could pull out later since a few of the button
  1846. command-keys I want to use are not the same as the first letter of the
  1847. button (ie. Add is usually command-G).
  1848.  
  1849. Is there anyway to tell if, when a double-byte script is installed the
  1850. user types the first half of a double-byte character? If so, I could
  1851. detect this, store the first half and if the second half comes thru in the
  1852. next event, do my compare as I would with a regular key.
  1853.  
  1854. I'd like to store the command-keys as a string resource with each key as
  1855. an individual string with the string id (index if in a STR# resource)
  1856. relating the particular button. Could I just compare the key entered with
  1857. the key stored in the string to see if they are equal or would I have to
  1858. use a special Script Manager comparison routine?
  1859.  
  1860. +++++++++++++++++++++++++++
  1861.  
  1862. >From ari@world.std.com (Ari I Halberstadt)
  1863. Date: Wed, 21 Sep 1994 04:19:44 GMT
  1864. Organization: The World Public Access UNIX, Brookline, MA
  1865.  
  1866. In article <resnick-1909942338050001@resnick1.isdn.uiuc.edu>,
  1867. Pete Resnick <resnick@uiuc.edu> wrote:
  1868. >In article <bb-1809941054400001@user53.lightside.com>, bb@lightside.com
  1869. >(Bob Bradley) wrote:
  1870. >
  1871. >> I have a simple dialog for "Don't Save, "Cancel", "Save" and want to
  1872. >> handle commands keys for the dialog correctly. Right now, I'm just
  1873. >> checking for 'D', Escape or Command Period (I am doing international
  1874. >> canceling), and Return or Enter, respectively but, I know there's a better
  1875. >> way.
  1876. >>...
  1877. >For single-byte languages, this is easy: Just do a GetControlTitle() for
  1878. >each of the controls in the dialog (doing a GetDialogItem() to get the
  1879. >control handles) and then compare the keystroke with the first character
  1880. >of the control title. Use the same method you do for command-period to
  1881. >make sure that you get the correct ASCII character code, and then make
  1882. >sure to use the CompareText() or IdenticalText() routines so that case and
  1883. >diacriticals are handled properly.
  1884.  
  1885. A resource that defines equivalence between buttons and command keys.
  1886. Use some special resource type, say "CMDK" or "DLCK" (dialog command
  1887. key), or whatever, and give it the same ID as the dialog or alert. Or
  1888. a <clover><char> syntax you tack onto the end of the button names,
  1889. then extract before displaying the dialog or alert. Other languages
  1890. might not have unique first-character button names, and you might not
  1891. want command key equivalence for some buttons, etc. so storing it in
  1892. the resource data is more flexible.
  1893. -- 
  1894. Ari Halberstadt                                 ari@world.std.com
  1895. One generation passes away, and another generation comes: but the
  1896. earth abides for ever. -- Ecclesiastes, 1:4.
  1897.  
  1898. +++++++++++++++++++++++++++
  1899.  
  1900. >From lalonde@metrowerks.ca (Paul Lalonde)
  1901. Date: Thu, 22 Sep 1994 23:46:20 GMT
  1902. Organization: Metrowerks
  1903.  
  1904. In article <bb-1809941054400001@user53.lightside.com>, bb@lightside.com
  1905. (Bob Bradley) wrote:
  1906.  
  1907. > I have a simple dialog for "Don't Save, "Cancel", "Save" and want to
  1908. > handle commands keys for the dialog correctly. Right now, I'm just
  1909. > checking for 'D', Escape or Command Period (I am doing international
  1910. > canceling), and Return or Enter, respectively but, I know there's a better
  1911. > way.
  1912. > I'd like to make the code localizable and to also get rid of data (the raw
  1913. > 'D' letter, etc..) from the source code (so I don't have t re-compile to
  1914. > change it).
  1915. > How would I go about this? I assume it would all be thru the use of the
  1916. > Script Manager but, I'm not sure on the implementation.
  1917.  
  1918. You would basically need a modal dialog filter proc in which, every time 
  1919. a key down was received with the command key down, you loop through all of 
  1920. the items in the dialog's item list.  If an item is a button, you retrieve 
  1921. its title and compare the first character with the character just pressed.
  1922.  
  1923. Of course, if you also want to deal with double-byte systems, you need to 
  1924. store state information between calls to the filter proc so you will know 
  1925. if a key corresponds to the first or second byte of a character.
  1926.  
  1927. Paul Lalonde
  1928. lalonde@metrowerks.ca
  1929.  
  1930. +++++++++++++++++++++++++++
  1931.  
  1932. >From bb@lightside.com (Bob Bradley)
  1933. Date: Wed, 21 Sep 1994 16:21:17 -0800
  1934. Organization: SS Software Inc.
  1935.  
  1936. In article <lalonde-2209941946200001@slip68.dialup.mcgill.ca>,
  1937. lalonde@metrowerks.ca (Paul Lalonde) wrote:
  1938.  
  1939. > You would basically need a modal dialog filter proc in which, every time 
  1940. > a key down was received with the command key down, you loop through all of 
  1941. > the items in the dialog's item list.  If an item is a button, you retrieve 
  1942. > its title and compare the first character with the character just pressed.
  1943. > Of course, if you also want to deal with double-byte systems, you need to 
  1944. > store state information between calls to the filter proc so you will know 
  1945. > if a key corresponds to the first or second byte of a character.
  1946.  
  1947. The way I'm doing it now is to create a key item command table when the
  1948. dialog is create based on a custom resource that contains the key (just a
  1949. 2 byte short), the item it goes with, and which modifiers are required
  1950. (ie. command, option, control) then when I get a key down, in my proc to
  1951. handle key downs in dialogs (they are all modeless) I search the table for
  1952. the typed key and check whether or not the correct modifiers were down
  1953. when it was pressed (I also use the method in the Tech Note International
  1954. Canceling to work with keyboards that discharge the shift key when the
  1955. command key is down). I also made a simple Resorcerer template for
  1956. creating and editing the key item command table
  1957.  
  1958. It seems to work ok but, I haven't tested it with any non-roman scripts.
  1959.  
  1960. ---------------------------
  1961.  
  1962. >From gpointer@guest.adelaide.edu.au (Geoff Pointer)
  1963. Subject: XCMD memory residence
  1964. Date: 19 Sep 1994 10:50:46 GMT
  1965. Organization: Individual
  1966.  
  1967.    I am trying to manage an external window for Hypercard. It is geared
  1968. to handle several windows open at once and I have handled the fact that
  1969. all windows will be using the same copy of the XCMD code. What I am not
  1970. clear about, is what can happen to the code resource in between event
  1971. calls. I am aware that it can be moved in memory but can it ever be
  1972. purged? I am presently basing my logic on the code not being purged and
  1973. being copied from its original location in memory when it is moved rather
  1974. than recopied from the original resource. Is it possible to get definitive
  1975. answers??
  1976.    My problem involves how I use certain globals (via A4, I use Code
  1977. Warrior). I use RefCon stuff for the globals that go with each individual
  1978. window, but I need special action for the first window open and the last
  1979. window closed, which involves retaining knowledge across individual event
  1980. calls.
  1981.  
  1982. - --------- Cheers - Geoff %^> ----------
  1983.  
  1984.   Voice: 61 8 362 9890     63 Lambert Rd
  1985.   Fax:   61 8 363 2682     Joslin SA 5070
  1986.                            Australia
  1987.  
  1988. - ---------------------------------------
  1989.  
  1990.  
  1991. +++++++++++++++++++++++++++
  1992.  
  1993. >From e-baumgartner@nwu.edu (Eric Baumgartner)
  1994. Date: Mon, 19 Sep 1994 16:27:53 -0500
  1995. Organization: Northwestern University
  1996.  
  1997. In article <35jqe6$qgt@quandong.itd.adelaide.edu.au>,
  1998. gpointer@guest.adelaide.edu.au (Geoff Pointer) wrote:
  1999.  
  2000. > all windows will be using the same copy of the XCMD code. What I am not
  2001. > clear about, is what can happen to the code resource in between event
  2002. > calls. I am aware that it can be moved in memory but can it ever be
  2003. > purged?
  2004.  
  2005. >    My problem involves how I use certain globals (via A4, I use Code
  2006. > Warrior). I use RefCon stuff for the globals that go with each individual
  2007. > window, but I need special action for the first window open and the last
  2008. > window closed, which involves retaining knowledge across individual event
  2009. > calls.
  2010.  
  2011. Yes, your xcmd can be purged in between event calls. If you want to use
  2012. "global globals" I know of two options:
  2013.  
  2014. 1. Tell HC that you have interrupt code by calling XWHasInterruptCode.
  2015. Evil, evil, evil, but it'll keep your code resource resident and locked.
  2016. 2. Use a HC global to store your globals. You could store the address of a
  2017. handle containing the globals, or you could store the globals themselves
  2018. in text form in the HC variable.
  2019.  
  2020. I'd be curious to hear if anyone has any other suggestions.
  2021.  
  2022. Eric Baumgartner                       *   Email: e-baumgartner@nwu.edu
  2023. Learning Sciences                      *   Phone: 708/467-2816
  2024. School of Education and Social Policy  *
  2025. Northwestern University                *
  2026.  
  2027. +++++++++++++++++++++++++++
  2028.  
  2029. >From ari@world.std.com (Ari I Halberstadt)
  2030. Date: Tue, 20 Sep 1994 01:01:20 GMT
  2031. Organization: The World Public Access UNIX, Brookline, MA
  2032.  
  2033. In article <35jqe6$qgt@quandong.itd.adelaide.edu.au>,
  2034. Geoff Pointer <gpointer@guest.adelaide.edu.au> wrote:
  2035. >   I am trying to manage an external window for Hypercard. It is geared
  2036. >to handle several windows open at once and I have handled the fact that
  2037. >all windows will be using the same copy of the XCMD code. What I am not
  2038. >clear about, is what can happen to the code resource in between event
  2039. >calls. I am aware that it can be moved in memory but can it ever be
  2040. >purged? I am presently basing my logic on the code not being purged and
  2041. >being copied from its original location in memory when it is moved rather
  2042. >than recopied from the original resource. Is it possible to get definitive
  2043. >answers??
  2044. >   My problem involves how I use certain globals (via A4, I use Code
  2045. >Warrior). I use RefCon stuff for the globals that go with each individual
  2046. >window, but I need special action for the first window open and the last
  2047. >window closed, which involves retaining knowledge across individual event
  2048. >calls.
  2049. >
  2050.  
  2051. You can mark the XCMD resource as non-purgeable. But that still
  2052. doesn't prevent HyperCard, or anyone else, from explicitely purging
  2053. it. Better to set a HyperCard global variable from within your XCMD.
  2054. There are a couple of call-backs for setting and retrieving a global
  2055. variable's value. When your XCMD exits, it sets the value of the
  2056. global to a handle to some structure containing the state information.
  2057. When the last window is disposed of, you clear the global (set it to
  2058. the empty string). You should give the global some unlikely name. For
  2059. instance, if the XCMD is called "MyXCMD", I'd call the global
  2060. "gMyXCMD". The "g" is just that Apple pseudo-standard for global
  2061. variables, and the "MyXCMD" part makes it clear to anyone looking at
  2062. the global in the debugger that it's part of your XCMD, and also
  2063. reduces the chance that someone will use the same name for their own
  2064. global variable.
  2065. -- 
  2066. Ari Halberstadt                                 ari@world.std.com
  2067. One generation passes away, and another generation comes: but the
  2068. earth abides for ever. -- Ecclesiastes, 1:4.
  2069.  
  2070. +++++++++++++++++++++++++++
  2071.  
  2072. >From jkc@apple.com (John Kevin Calhoun)
  2073. Date: 22 Sep 1994 16:45:21 -0700
  2074. Organization: Apple Computer Inc, Cupertino, CA
  2075.  
  2076.  
  2077. In article <35jqe6$qgt@quandong.itd.adelaide.edu.au>,
  2078. Geoff Pointer <gpointer@guest.adelaide.edu.au> wrote:
  2079. >   I am trying to manage an external window for Hypercard. It is geared
  2080. >to handle several windows open at once and I have handled the fact that
  2081. >all windows will be using the same copy of the XCMD code. What I am not
  2082. >clear about, is what can happen to the code resource in between event
  2083. >calls. I am aware that it can be moved in memory but can it ever be
  2084. >purged? I am presently basing my logic on the code not being purged and
  2085. >being copied from its original location in memory when it is moved rather
  2086. >than recopied from the original resource. Is it possible to get definitive
  2087. >answers??
  2088.  
  2089. It's not possible to prevent an XCMD or XFCN resource from being purged
  2090. unless you also prevent it from being moved.  You can do this with
  2091. the callback XWHasInterruptCode, which, in effect, locks the resource
  2092. in memory.  However, leaving something locked in an unpredictable
  2093. location in HyperCard's heap is a very unfriendly thing to do, unless
  2094. it's absolutely necessary.
  2095.  
  2096. Furthermore, Apple does not guarantee that HyperCard's handling of
  2097. XCMD and XFCN resources will remain the same with each release of
  2098. HyperCard; in fact, it changed between 1.x and 2.x and might change
  2099. again.  Therefore I think it's not wise to rely on the way HyperCard
  2100. currently executes external code.
  2101.  
  2102. >   My problem involves how I use certain globals (via A4, I use Code
  2103. >Warrior). I use RefCon stuff for the globals that go with each individual
  2104. >window, but I need special action for the first window open and the last
  2105. >window closed, which involves retaining knowledge across individual event
  2106. >calls.
  2107.  
  2108. Instead of relying on A4 globals, you can store and update a count
  2109. of your windows in a HyperTalk global, which you can access via the
  2110. SetGlobal and GetGlobal callbacks.
  2111.  
  2112. With HyperCard 2.2, it's possible to count your windows on the fly,
  2113. as follows:
  2114.  
  2115.   function countWindowsOf externalName
  2116.     put 0 into count
  2117.     repeat with thisWindow = 1 to the number of windows
  2118.       if the owner of window thisWindow is externalName
  2119.       then add 1 to count
  2120.     end repeat
  2121.     return count
  2122.   end countWindowsOf
  2123.  
  2124. >From an external you could execute similar HyperTalk code by
  2125. using the RunHandler callback.
  2126.  
  2127. Kevin Calhoun
  2128. jkc@apple.com
  2129.  
  2130. ---------------------------
  2131.  
  2132. End of C.S.M.P. Digest
  2133. **********************
  2134.  
  2135.  
  2136.