home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / CSMP Digest / volume 1 / csmp-v1-109.txt < prev    next >
Encoding:
Text File  |  1992-12-31  |  42.1 KB  |  1,076 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Tue, 09 Jun 92       Volume 1 : Issue 109
  2.  
  3. Today's Topics:
  4.  
  5.     LaserWriter Reboot Code in PS?
  6.     Floating Windowiods and MacApp 3.0
  7.     Apple User Interface Police
  8.     Offscreen graphics sans Color QuickDraw?
  9.     Finding the VolID and DirID of the App
  10.     ics#/ics4/ics8 in menus
  11.     Tech Note or Other Apple Doc on MIDI
  12.     AppleEvents and TCL
  13.     Drag and Drop onto a document?
  14.  
  15.  
  16. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  17.  
  18. These digests are available (by using FTP, account anonymous, your email
  19. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  20. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  21. Questions list.  The last several issues of the digest are available from
  22. sumex-aim.stanford.edu as well.
  23.  
  24. These digests are also available via email.  Just send a note saying that you
  25. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  26. automatically receive each new digest as it is created.
  27.  
  28. The digest is a collection of articles from the internet newsgroup comp.sys.
  29. mac.programmer.  It is designed for people who read c.s.m.p. semi-regularly
  30. and want an archive of the discussions.  If you don't know what a newsgroup
  31. is, you probably don't have access to it.  Ask your systems administrator(s)
  32. for details.  (This means you can't post questions to the digest.)
  33.  
  34. The articles in these digests are taken directly from comp.sys.mac.programmer.
  35. They are not edited; all articles included in this digest are in their original
  36. posted form.  The only articles that are -not- included in these digests are
  37. those which didn't receive any replies (except those that give information
  38. rather than ask a question).  All replies to each article are concatenated
  39. onto the original article in the order in which they were received.  Article
  40. threads are not added to the digests until the last article added to the
  41. thread is at least one month old (this is to ensure that the thread is dead
  42. before adding it to the digests).
  43.  
  44. Send administrative mail to           fone: +64-7-856-2889
  45. Computer Services Dept                     fax: +64-7-838-4066
  46. University of Waikato            electric mail: ldo@waikato.ac.nz
  47. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
  48. virus order sentences of words in signature the rearranges This.
  49.  
  50. ---------------------------
  51.  
  52. From: michaelp@calvin.usc.edu (Michael Peterson)
  53. Subject: Floating Windowiods and MacApp 3.0
  54. Date: 28 Apr 92 23:57:34 GMT
  55. Organization: University of Southern California, Los Angeles, CA
  56.  
  57.  
  58.  
  59. PROBLEM:
  60.     I'm trying to get a windowiod up in MapApp 3.0 and am having
  61. problems. Has anyone done this before and if so how.
  62.  
  63.     I am calling InitUFloatWindow, changing the window resource to the
  64. TFLOATWINDOW class, including the "FloatWindow.rsrc" and everything else I can think of.
  65.  
  66. RESULTS:
  67.     Every little.  The NewTemplateWindow call doesn't return nil,
  68. but the window does not come up. while other normal windows do.
  69.  
  70.  
  71.                 Please help.
  72.                 A Man without a Window.
  73.  
  74. +++++++++++++++++++++++++++
  75.  
  76. From: ksand@apple.com (Kent Sandvik)
  77. Date: 9 May 92 02:20:03 GMT
  78. Organization: MacDTS Mongols
  79.  
  80. In article <kvrpjeINNqn@calvin.usc.edu>, michaelp@calvin.usc.edu (Michael
  81. Peterson) writes:
  82. > PROBLEM:
  83. >     I'm trying to get a windowiod up in MapApp 3.0 and am having
  84. > problems. Has anyone done this before and if so how.
  85. >     I am calling InitUFloatWindow, changing the window resource to the
  86. > TFLOATWINDOW class, including the "FloatWindow.rsrc" and everything else I can
  87. think of.
  88. > RESULTS:
  89. >     Every little.  The NewTemplateWindow call doesn't return nil,
  90. > but the window does not come up. while other normal windows do.
  91.  
  92. There's a sample on ftp.apple.com, somewhere inside the snippets directory,
  93. called Windoid. It's a MacApp 3.0a2 based sample that shows how to create
  94. tear-off
  95. menu windoids.
  96.  
  97. Yes, I know, I should clean up the code for MacApp 3.0 final, and that's
  98. exactly what I'm working on just now. Later (don't know when) my MouseInfo
  99. Behavior sample should also appear on the ftp server, and this one also
  100. has a floating window palette.
  101.  
  102. Cheers,
  103. Kent
  104. PS: Keith, how many grammar errors?
  105. PSS: "Reality is what refuses to go away when I stop believing in it."
  106.  
  107. ---------------------------
  108.  
  109. From: mxmora@unix.SRI.COM (Matt Mora)
  110. Subject: Apple User Interface Police
  111. Date: 27 Apr 92 16:42:18 GMT
  112. Organization: SRI International, Menlo Park, California
  113.  
  114.  
  115. I thought I read somewhere that AUIP frowned upon changing the cursor location
  116. on the user. (ie moving the cursor over the default button like they do
  117. on the Sun Platform) After searching the technotes and the Developer CD's
  118. I could not find this reference. Does this guideline exsist or am I making it 
  119. up?
  120.  
  121. Thanks
  122.  
  123. Matt
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132. - -- 
  133. ___________________________________________________________
  134. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  135. SRI International           |  my unix  mxmora@unix.sri.com
  136. ___________________________________________________________
  137.  
  138. +++++++++++++++++++++++++++
  139.  
  140. From: quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  141. Date: 28 Apr 92 02:14:34 GMT
  142. Organization: The University of Western Australia
  143.  
  144. In article <34598@unix.SRI.COM>, mxmora@unix.SRI.COM (Matt Mora) writes:
  145. > I thought I read somewhere that AUIP frowned upon changing the cursor location
  146. > on the user. (ie moving the cursor over the default button like they do
  147. > on the Sun Platform) After searching the technotes and the Developer CD's
  148. > I could not find this reference. Does this guideline exsist or am I making it 
  149. > up?
  150.  
  151. I think the User Interface Thought Police didn't put that recommendation in
  152. because they couldn't believe anyone could be that *stupid*.  But Sun
  153. Microsystems astound the world again.  I think you can put jumping the
  154. pointer about in the same basket as Sun's other 'crowning achievements' like:
  155.  
  156. o talk(1) still being host byte order dependent
  157. o Sun workstations still using all zero's for broadcasts
  158.  
  159. This leads me to question whether Sun is getting technical advice from
  160. Microsloth or vice versa (-:
  161.  
  162. Quinn "The Eskimo!"   <quinn@cs.uwa.edu.au>  "Real Coke, Diet .sig"
  163. Department of Computer Science, The University of Western Australia
  164.   -- Who feels safe flaming Sun in a Mac group (-:
  165.  
  166. +++++++++++++++++++++++++++
  167.  
  168. From: lsr@taligent.com (Larry Rosenstein)
  169. Date: 28 Apr 92 22:43:22 GMT
  170. Organization: Taligent, Inc.
  171.  
  172. In article <34598@unix.SRI.COM>, mxmora@unix.SRI.COM (Matt Mora) wrote:
  173. > I thought I read somewhere that AUIP frowned upon changing the cursor location
  174.  
  175. I guess there's no specific guideline about this, perhaps since there's no
  176. official system call to move the pointer.  (Pointer is the official name.)  The
  177. closest would be the statement that users want to feel that they are in charge
  178. of the computer's activities.
  179.  
  180. - -----
  181. Larry Rosenstein
  182. Taligent, Inc.
  183. lsr@taligent.com
  184.  
  185. +++++++++++++++++++++++++++
  186.  
  187. From: andrew@cubetech.com (Andrew Loewenstern)
  188. Date: 28 Apr 92 20:17:28 GMT
  189. Organization: Cube Technologies, Inc.
  190.  
  191. In article <34598@unix.SRI.COM> mxmora@unix.SRI.COM (Matt Mora) writes:
  192. >
  193. >I thought I read somewhere that AUIP frowned upon changing the cursor location
  194. >on the user. (ie moving the cursor over the default button like they do
  195. >on the Sun Platform) After searching the technotes and the Developer CD's
  196. >I could not find this reference. Does this guideline exsist or am I making it 
  197. >up?
  198.  
  199. I don't remember seeing this explicitly stated somewhere, but it would
  200. make sense for this to be a nono.  Many people would get confused if
  201. the cursor started moving around on them.
  202.  
  203.  
  204. andrew
  205. - -- 
  206. andrew@cubetech.com
  207. Andrew Loewenstern            |  "listen: there's a hell of a good universe
  208. Cube Technologies, Inc.       |   next door; let's go." --- e.e. cummings
  209.  
  210. +++++++++++++++++++++++++++
  211.  
  212. From: tar@ISI.EDU (Thomas A. Russ)
  213. Date: 29 Apr 92 16:50:02 GMT
  214. Organization: USC-ISI
  215.  
  216. In article <...> andrew@cubetech.com (Andrew Loewenstern) writes:
  217.  
  218.    In article <...> mxmora@unix.SRI.COM (Matt Mora) writes:
  219.    >
  220.    >I thought I read somewhere that AUIP frowned upon changing the
  221.    >cursor location on the user. (ie moving the cursor over the
  222.    >default button like they do on the Sun Platform) After searching
  223.    >the technotes and the Developer CD's I could not find this
  224.    >reference. Does this guideline exsist or am I making it up?
  225.  
  226.    I don't remember seeing this explicitly stated somewhere, but it would
  227.    make sense for this to be a nono.  Many people would get confused if
  228.    the cursor started moving around on them.
  229.  
  230. I second this opinion.  I hate it when the Sun moves my cursor for me.
  231. I start trying to move it and end up moving it off the button and then
  232. back on again.  Unless the cursor is hidden because the user has been
  233. doing something completely different, please don't move it.  The Apple
  234. User Interface philosophy is that the user is in control of the
  235. machine, not the other way around.
  236. - --
  237.  
  238. Thomas A. Russ                               tar@isi.edu    
  239. USC/ISI, 4676 Admiralty Way, Marina del Rey, CA 90292          (310) 822-1511
  240.  
  241. +++++++++++++++++++++++++++
  242.  
  243. From: felciano@medisg.stanford.edu (Ramon M. Felciano)
  244. Date: 29 Apr 92 19:26:09 GMT
  245. Organization: SUMMIT (Stanford Univ. Medical Media and Information
  246.  
  247.  
  248. I agree whole heartedly -- the cursor should always be left completely in
  249. the user's control. Quickkeys sequences (macros) have the cursor jump all
  250. over the place, and it is >very< distressing!
  251.  
  252. Ramon M. Felciano
  253. Associate Director, SUMMIT
  254. Stanford University Medical Media and Information Technologies
  255.  
  256. +++++++++++++++++++++++++++
  257.  
  258. From: Bruce.Hoult@bbs.actrix.gen.nz
  259. Date: Thu, 30 Apr 1992 11:42:01 GMT
  260. Organization: Actrix Information Exchange
  261.  
  262. I don't know whether it still does (and I don't have it on this machine
  263. to check) but old versions of Excel used to move the cursor by themselves.
  264.  
  265. What happened (deduced from playing with it) was that Microsoft made dragging
  266. the scroll bar thumbs non-linear for better control of small movements around
  267. the spreadsheet.  It semed to be roughly quadratic: if you were in the middle
  268. of the sheet and dragged the thumb to the 75% mark (i.e. half way from where
  269. you were to the end) then you'd actually move a quarter of the way towards
  270. the end (i.e. to 62.5% of the way in the document).
  271.  
  272. The problem with this is of course that now that you're 62.5% of the way
  273. through the document, the scroll bar thumb should also be 62.5% of the way.
  274. So when you released the mouse button they snapped the thumb back to
  275. the 62.5% mark, and at the same time moved the mouse pointer by the same
  276. amount so that it was still positioned over the thumb, ready to drag the
  277. thumb again.
  278.  
  279. Now I don't know whether or not it was a quadratic law or some other
  280. formula, but I do know that the pointer and thumb both snapped to a
  281. different position when you released the button in the way described
  282. and most people didn't notice it.
  283.  
  284. - -- 
  285. Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
  286. BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
  287. "Cray's producing a 200 MIPS personal computer with 64MB RAM and a 1 GB
  288. hard disk that fits in your pocket!"   "Great!  Is it PC compatable?"
  289.  
  290. +++++++++++++++++++++++++++
  291.  
  292. From: davidm@sfsuvax1.sfsu.edu (David Morgenstern)
  293. Date: 1 May 92 15:34:46 GMT
  294. Organization: San Francisco State University
  295.  
  296. Who is in charge of the Interface Police now that Tog, Dr. Bob, and
  297. a bunch of other Human Interfacers have gone over to SUN? Who's
  298. running the store (or station)?
  299.  
  300. daviD
  301. - -- 
  302. *****     David Morgenstern (a.k.a. BMUG CheerLeader)     *****
  303. *     CIS: 72030,1607   AOL: daviD eM   FAX: 510-849-9026     *
  304.  
  305. +++++++++++++++++++++++++++
  306.  
  307. From: kvail@dbri.com (Kevin Vail)
  308. Date: 30 Apr 92 15:36:47 GMT
  309. Organization: DB Resources, Inc., Vienna, VA
  310.  
  311. In article <66222@apple.Apple.COM> lsr@taligent.com (Larry Rosenstein) writes:
  312. >In article <34598@unix.SRI.COM>, mxmora@unix.SRI.COM (Matt Mora) wrote:
  313. >> I thought I read somewhere that AUIP frowned upon changing the cursor 
  314. >> location 
  315. >
  316. >I guess there's no specific guideline about this, perhaps since there's no
  317. >official system call to move the pointer.  (Pointer is the official name.)  The
  318. >closest would be the statement that users want to feel that they are in charge
  319. >of the computer's activities.
  320.  
  321. Vision does this (moves the pointer) when you select one of their pop-up
  322. menu things, and what's more they put it back where it was when you exit.
  323. It's very disorienting even when you're expecting it.
  324.  
  325. +----------------------------------+-------------------------------------+
  326. |  |<evin |\/|ichael \/ail         |  ...and the only measure            |
  327. |  kvail@dbri.com                  |     of your words and your deeds    |
  328. |  kevin@vailbox.washington.dc.us  |  will be the love you leave behind  |
  329. |  uunet!vailbox!kevin             |     when you're gone...             |
  330. +----------------------------------+-------------------------------------+
  331.  
  332. +++++++++++++++++++++++++++
  333.  
  334. From: ksand@apple.com (Kent Sandvik)
  335. Date: 4 May 92 21:59:31 GMT
  336. Organization: MacDTS Mongols
  337.  
  338. In article <1992May1.153446.29775@csus.edu>, davidm@sfsuvax1.sfsu.edu (David
  339. Morgenstern) writes:
  340. > Who is in charge of the Interface Police now that Tog, Dr. Bob, and
  341. > a bunch of other Human Interfacers have gone over to SUN? Who's
  342. > running the store (or station)?
  343.  
  344. ..maybe they didn't have much challenges anymore inside Apple,
  345. and they saw a fruitful environment where interfaces are still
  346. primitive :-).
  347.  
  348. Just joking.
  349. Kent
  350.  
  351. +++++++++++++++++++++++++++
  352.  
  353. From: Thad.Humphries@p950.f70.n109.z1.fidonet.org (Thad Humphries)
  354. Date: 5 May 92 03:37:26 GMT
  355.  
  356.  
  357.   > I guess there's no specific guideline about this, perhaps since there's
  358.   > no official system call to move the pointer.  (Pointer is the official
  359.   > name.)  The closest would be the statement that users want to feel that
  360.   > they are in charge of the computer's activities.
  361.   > 
  362.   KV> Vision does this (moves the pointer) when you select one of their
  363.   KV> pop-up menu things, and what's more they put it back where it was when
  364.   KV> you exit. It's very disorienting even when you're expecting it.
  365.  
  366. One reason that SunView and XView/OPENLOOK does this is that the Sun's screen is
  367. to large that it is very nice not to have to find your cursor for a small dialog
  368. box.
  369.  
  370. +++++++++++++++++++++++++++
  371.  
  372. From: sandy@beeker.cs.umass.edu (& Wise)
  373. Date: 6 May 92 14:43:03 GMT
  374. Organization: Organization?  I thought entropy would take care of that...
  375.  
  376. In article <705135642.F00001@blkcat.UUCP> Thad.Humphries@p950.f70.n109.z1.fidonet.org (Thad Humphries) writes:
  377.  >    > I guess there's no specific guideline about this, perhaps since there's
  378.  >    > no official system call to move the pointer.  (Pointer is the official
  379.  >    > name.)  The closest would be the statement that users want to feel that
  380.  >    > they are in charge of the computer's activities.
  381.  >    > 
  382.  >    KV> Vision does this (moves the pointer) when you select one of their
  383.  >    KV> pop-up menu things, and what's more they put it back where
  384.  >    KV> it was when KV> you exit. It's very disorienting even when
  385.  >    KV> you're expecting it.
  386.  >
  387.  >  One reason that SunView and XView/OPENLOOK does this is that the
  388.  >  Sun's screen is to large that it is very nice not to have to find
  389.  >  your cursor for a small dialog box.
  390.  
  391. I use X on a monochrome DECstation (1280x1024 -- 19" VR319) which is
  392. slightly larger than the display on the Sun 3/60, but I only have
  393. trouble finding the pointer if the system has moved it (e.g.,
  394. Interleaf). Display size does not seem to be a factor for all users.
  395.  
  396. Unfortunately, I cannot find any references to formal studies on the
  397. issue.  I did find references in the DEC XUI and Motif style guides.
  398. Since the Motif guide is derived from XUI's, I only quote the Motif
  399. one:
  400.         2.2.3.2 The Pointer
  401.         ...
  402.         Your application should only interpret the mouse pointer
  403.         position; it should not attempt to change it. To do so would
  404.         violate users' trust in the consistency of your program and
  405.         their sense of control. Also, changing the mouse pointer
  406.         location may create problems in applications that use absolute
  407.         location devices (like graphics tablets).
  408.  
  409.         /s
  410. - --
  411. Alexander Erskine Wise /\/\/\/\/\/\/\/\/\/\/\/\ Software Development Laboratory
  412. /\/\/\/\/\/\/\/\/\/\/\/\/\/\ WISE@CS.UMASS.EDU /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  413. \/\/\ This situation calls for large amounts of unadulterated CHOCOLATE! /\/\/\
  414.  
  415. +++++++++++++++++++++++++++
  416.  
  417. From: ksand@apple.com (Kent Sandvik)
  418. Date: 7 May 92 23:42:20 GMT
  419. Organization: MacDTS Mongols
  420.  
  421. In article <1992Apr28.021434.19913@bilby.cs.uwa.edu.au>, quinn@cs.uwa.edu.au
  422. (Quinn "The Eskimo!") writes:
  423. > In article <34598@unix.SRI.COM>, mxmora@unix.SRI.COM (Matt Mora) writes:
  424. > > 
  425. > > I thought I read somewhere that AUIP frowned upon changing the cursor
  426. location
  427. > > on the user. (ie moving the cursor over the default button like they do
  428. > > on the Sun Platform) After searching the technotes and the Developer CD's
  429. > > I could not find this reference. Does this guideline exsist or am I making
  430. it 
  431. > > up?
  432.  
  433. > I think the User Interface Thought Police didn't put that recommendation in
  434. > because they couldn't believe anyone could be that *stupid*.  But Sun
  435. > Microsystems astound the world again.  I think you can put jumping the
  436. > pointer about in the same basket as Sun's other 'crowning achievements' like:
  437.  
  438. No wonder they need Tog more than we nowadays :-).
  439.  
  440. Cheers,
  441. Kent
  442.  
  443. ---------------------------
  444.  
  445. Subject: Offscreen graphics sans Color QuickDraw?
  446. From: jmatthews@desire.wright.edu
  447. Date: 7 May 92 15:24:35 EST
  448. Organization: Wright State University 
  449.  
  450. I'm in a bit of trouble with System 7 offscreen graphics world routines
  451. on Macs without ColorQuickDraw.
  452.  
  453. I'm using THINK Pascal 4.0.1 under System 7.0 (tuneup 1.1.1). I create
  454. an offscreen world and lock it without error:
  455.  
  456.   SetRect(rWorld, 0, 0, 550, 550);
  457.   err := NewGWorld(offWorldPtr, 0, rWorld, nil, nil, []);
  458.   locked := LockPixels(MyGetPixMap(offWorldPtr));
  459.  
  460. I call GetGWorldPixMap only when appropriate:
  461.  
  462.   function MyGetPixMap (gwPtr: GWorldPtr): PixMapHandle;
  463.   begin
  464.     if hasGGWPM then {according to Q & A stack}
  465.       MyGetPixMap := GetGWorldPixMap(gwPtr)
  466.     else
  467.       MyGetPixMap := gwPtr^.portPixMap;
  468.   end;
  469.  
  470. I initialize offWorld without incident:
  471.  
  472.   GetGWorld(savePort, saveGDH);
  473.   SetGWorld(offWorldPtr, nil);
  474.   rWorld := offWorldPtr^.portRect;
  475.   EraseRect(rWorld);
  476.   if hasCQD then {ColorQuickDraw only stuff};
  477.   SetGWorld(savePort, saveGDH);
  478.  
  479. I repeatedly draw off-screen then on-screen:
  480.  
  481.   GetGWorld(savePort, saveGDH);
  482.   GetForeColor(saveColor);
  483.   if hasCQD then
  484.     RGBForeColor(deltaColor);
  485.   SetGWorld(offWorldPtr, nil); {draw offscreen}
  486.   MoveTo(ix, iy);
  487.   Line(0, 0);
  488.   ix := ix - left; {translate to screen}
  489.   iy := iy - top;
  490.   SetGWorld(savePort, saveGDH); {draw onscreen}
  491.   MoveTo(ix, iy);
  492.   Line(0, 0); {<-----Bomb: illegal instruction in an 'scod' resource}
  493.   RGBForeColor(saveColor);
  494.   PenNormal;
  495.  
  496. This all works fine on a Mac II, IIcx, IIfx, and Classic II; it
  497. survives heap scrambling and strict discipline; it bombs on a
  498. Classic!? I'm pretty sure I'm not generating any 020/030 instructions.
  499. Still, I'm doing _something_ to make the Classic think it's safe to
  500. execute such code.
  501.  
  502. Any thoughts on this? Thanks in advance.
  503.  
  504. o----------------------------------------------------------------------------o
  505. | John B. Matthews, jmatthews@desire.wright.edu, disclaimer:= myViews <> WSU |
  506. | "I'm a commensal .sig virus, indistinguishable from an ordinary organelle."|
  507. o----------------------------------------------------------------------------o
  508.  
  509. ---------------------------
  510.  
  511. From: jack@umbio.med.miami.edu (Jack Herrington)
  512. Subject: Finding the VolID and DirID of the App
  513. Date: 1 May 92 20:12:50 GMT
  514. Organization: University of Miami Medical School
  515.  
  516. Anyone got a good way to find the directory ID and volume ID of the
  517. application.  This is useful when the user launches from a document
  518. in a different directory and your app depends on files that are in the
  519. same directory as the app...
  520.  
  521. Any help?
  522. - -- 
  523. "Electric word 'life', it means forever and that's a might long time.  But I'm
  524.  here to tell yah, there's something else... The after-life, a word of
  525.  never-ending happiness, you can always see the sun, day or night.  So when you
  526.  call up that shrink in Beverly hills, you know the one, Dr. everything-we-all-
  527.  
  528. +++++++++++++++++++++++++++
  529.  
  530. From: jack@umbio.med.miami.edu (Jack Herrington)
  531. Date: 1 May 92 21:21:47 GMT
  532. Organization: University of Miami Medical School
  533.  
  534. jack@umbio.med.miami.edu (Jack Herrington) writes:
  535. : Anyone got a good way to find the directory ID and volume ID of the
  536. : application.  This is useful when the user launches from a document
  537. : in a different directory and your app depends on files that are in the
  538. : same directory as the app...
  539.  
  540. Great, I get to answer my own question.  (I gave up a little too early on
  541. this one).  Here is the solution:
  542.  
  543.     ////
  544.     //// Get the home directory of the application
  545.     ////
  546.  
  547. Boolean GetApplicationHome(short *theVolID,long *theDirID)
  548. {
  549.     FCBPBRec ourRec;
  550.     Boolean retVal;
  551.     short ourVolID,ourResID;
  552.     long ourDirID;
  553.  
  554.         //// Load the return variables initially with -1
  555.  
  556.     *theVolID = (-1);
  557.     *theDirID = (-1);
  558.  
  559.         //// Store the refNum of the current resource file
  560.         //// (at opening time, this will be the applications
  561.         //// resource fork)
  562.  
  563.     ourResID = CurResFile();
  564.  
  565.         //// Figure that we will be successful
  566.  
  567.     retVal = true;
  568.  
  569.         //// Get the volume ID of the resource fork
  570.  
  571.     if ( GetVRefNum(ourResID,&ourVolID) != noErr ) return false;
  572.  
  573.         //// Put together a 'FCBPBRec' record to ask for the dirID
  574.  
  575.     ourRec.qLink = 0L;
  576.     ourRec.qType = 0;
  577.     ourRec.ioTrap = 0L;
  578.     ourRec.ioCmdAddr = 0L;
  579.     ourRec.ioCompletion = 0L;
  580.     ourRec.ioFCBIndx = 0;
  581.     ourRec.ioVRefNum = ourVolID;
  582.     ourRec.ioRefNum = ourResID;
  583.     ourRec.ioNamePtr = 0L;
  584.  
  585.         //// Send the record synchronously and store the return value
  586.  
  587.     if ( PBGetFCBInfo(&ourRec,false) == noErr )
  588.         ourDirID = ourRec.ioFCBParID;
  589.     else retVal = false;
  590.  
  591.         //// Store the values in the variable passed
  592.  
  593.     if ( retVal == true )
  594.     {
  595.         *theVolID = ourVolID;
  596.         *theDirID = ourDirID;
  597.     }
  598.  
  599.         //// Return if we were successful
  600.  
  601.     return retVal;
  602. }
  603. - -- 
  604. "Electric word 'life', it means forever and that's a might long time.  But I'm
  605.  here to tell yah, there's something else... The after-life, a word of
  606.  never-ending happiness, you can always see the sun, day or night.  So when you
  607.  call up that shrink in Beverly hills, you know the one, Dr. everything-we-all-
  608.  
  609. +++++++++++++++++++++++++++
  610.  
  611. From: jeremyr@dcs.qmw.ac.uk (Jeremy Roussak)
  612. Date: 5 May 92 19:24:43 GMT
  613. Organization: Computer Science Dept, QMW, University of London
  614.  
  615. In <1992May1.201250.5257@newssun.med.miami.edu> jack@umbio.med.miami.edu (Jack Herrington) writes:
  616.  
  617. >Anyone got a good way to find the directory ID and volume ID of the
  618. >application.  This is useful when the user launches from a document
  619. >in a different directory and your app depends on files that are in the
  620. >same directory as the app...
  621.  
  622. >Any help?
  623.  
  624. Use PBGetFCBInfo (IM IV-179) with ioRefNum equal to
  625. CurResFile().  This works nicely.
  626.  
  627. Jeremy Roussak
  628.  
  629. +++++++++++++++++++++++++++
  630.  
  631. From: peter@cujo.curtin.edu.au (Peter N Lewis)
  632. Organization: NCRPDA, Curtin University
  633. Date: Wed, 6 May 1992 06:43:17 GMT
  634.  
  635. In article <1992May5.192443.2270@dcs.qmw.ac.uk>, jeremyr@dcs.qmw.ac.uk (Jeremy Roussak) writes:
  636.  
  637. > >Anyone got a good way to find the directory ID and volume ID of the
  638. > >application.  This is useful when the user launches from a document
  639. > >in a different directory and your app depends on files that are in the
  640. > >same directory as the app...
  641.  
  642. > Use PBGetFCBInfo (IM IV-179) with ioRefNum equal to
  643. > CurResFile().  This works nicely.
  644.  
  645. I preffer 
  646. oe:=GetVol(wdrn,nil)
  647. oe:=GetWDInfo(wdrn,vrn,dirID,procID);
  648.  
  649. I tried using the wdrn in the GetAppParms instead of GetVol, but it failed, 
  650. anyone know why GetAppParms wouldnt work (under System 7)?
  651.  
  652. Have fun all,
  653.    Peter.
  654.  
  655. ______________________________________________________________________
  656. Peter N Lewis, NCRPDA, Curtin University      peter@cujo.curtin.edu.au
  657. GPO Box U1987, Perth WA 6001, AUSTRALIA            FAX: +61 9 367 8141
  658.  
  659.  
  660.  
  661. +++++++++++++++++++++++++++
  662.  
  663. From: keith@taligent.com (Keith Rollin)
  664. Date: 7 May 92 23:07:55 GMT
  665. Organization: Taligent
  666.  
  667. In article <1992May6.064317.2801@cujo.curtin.edu.au>, peter@cujo.curtin.edu.au
  668. (Peter N Lewis) writes:
  669. > In article <1992May5.192443.2270@dcs.qmw.ac.uk>, jeremyr@dcs.qmw.ac.uk (Jeremy
  670. Roussak) writes:
  671. > > >Anyone got a good way to find the directory ID and volume ID of the
  672. > > >application.  This is useful when the user launches from a document
  673. > > >in a different directory and your app depends on files that are in the
  674. > > >same directory as the app...
  675. > > Use PBGetFCBInfo (IM IV-179) with ioRefNum equal to
  676. > > CurResFile().  This works nicely.
  677. > I preffer 
  678. > oe:=GetVol(wdrn,nil)
  679. > oe:=GetWDInfo(wdrn,vrn,dirID,procID);
  680.  
  681. I prefer:
  682.  
  683. err = HGetVol(nil, &vRefNum, &dirID);
  684.  
  685. not only because it's one call shorter, but also because it's in C   :-)
  686.  
  687. Remember, this call must be made _before_ doing anything that could change the
  688. default directory. If you need to find out what directory you are in at any old
  689. time, then the GetFCBInfo trick (like the way Jack did it in his follow-up
  690. posting) is OK.
  691.  
  692. >I tried using the wdrn in the GetAppParms instead of GetVol, but it failed, 
  693. >anyone know why GetAppParms wouldnt work (under System 7)?
  694.  
  695. GetAppParms doesn't return the same information as GetVol. The former returns
  696. the name and resRefNum of the running application. The latter returns the
  697. vRefNum or wdRefNum of the default directory or volume.
  698.  
  699. - --
  700. Keith Rollin
  701. Phantom Programmer
  702. Taligent, Inc.
  703.  
  704.  
  705. +++++++++++++++++++++++++++
  706.  
  707. From: Martin.Friedrich@arbi.informatik.uni-oldenburg.de (Martin Friedrich)
  708. Date: 8 May 92 06:57:09 GMT
  709. Organization: University of Oldenburg, Germany
  710.  
  711. peter@cujo.curtin.edu.au (Peter N Lewis) writes:
  712.  
  713. >In article <1992May5.192443.2270@dcs.qmw.ac.uk>, jeremyr@dcs.qmw.ac.uk (Jeremy Roussak) writes:
  714.  
  715. >> >Anyone got a good way to find the directory ID and volume ID of the
  716. >> >application.  This is useful when the user launches from a document
  717. >> >in a different directory and your app depends on files that are in the
  718. >> >same directory as the app...
  719.  
  720. >> Use PBGetFCBInfo (IM IV-179) with ioRefNum equal to
  721. >> CurResFile().  This works nicely.
  722.  
  723. >I preffer 
  724. >oe:=GetVol(wdrn,nil)
  725. >oe:=GetWDInfo(wdrn,vrn,dirID,procID);
  726.  
  727. [...]
  728. Another way is to get the information via the Process Manager (Sys7,of course)
  729. from the processInfo-record of the application.
  730. - -- 
  731. LLaP
  732.        Martin Friedrich
  733.  
  734. - -----------------------------------------------------------------------------
  735.                          |"I never will understand
  736. REAL      Martin Friedrich   (CS-Student)    | humans ..."
  737. NICK      jupp                               | -- Spock, Patterns of Force
  738. UUCP      friedrich@uniol                    --------------------------------
  739. DOMAIN    Martin.Friedrich@arbi.informatik.uni-oldenburg.de
  740. HOME      Straekweg 1 , 2986 Leezdorf
  741.  
  742.      You can call me by my nickname,my nickname is ... SIR !
  743. - -----------------------------------------------------------------------------
  744.  
  745. +++++++++++++++++++++++++++
  746.  
  747. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  748. Date: 8 May 92 11:01:03 GMT
  749. Organization: Royal Institute of Technology, Stockholm, Sweden
  750.  
  751. > keith@taligent.com (Keith Rollin) writes:
  752.  
  753.    err = HGetVol(nil, &vRefNum, &dirID);
  754.  
  755.    not only because it's one call shorter, but also because it's in C   :-)
  756.  
  757. Ah, but you+ll get a wdRefNum in the vRefNum parameter, so you can't
  758. use that for testing which volume you're on. You still have to
  759. convert the wdRefNum to a vRefNum/dirID pair and discard the dirID
  760. from that conversion.
  761.  
  762. Why would I want to compare vRefNums, you say ? Well, I use the
  763. "relative" feature of aliases.
  764.  
  765. - -- 
  766. h++ - new and improved !
  767.  
  768. "It's simple. Some people have braces in their names, and some don't. You'll
  769.    just have to accept it the way it is." - Me: h+@nada.kth.se; Jon W{tte
  770.  
  771. +++++++++++++++++++++++++++
  772.  
  773. From: keith@taligent.com (Keith Rollin)
  774. Date: 8 May 92 22:49:59 GMT
  775. Organization: Taligent
  776.  
  777. In article <D88-JWA.92May8120103@dront.nada.kth.se>, d88-jwa@dront.nada.kth.se
  778. (Jon W{tte) writes:
  779. > > keith@taligent.com (Keith Rollin) writes:
  780. >    err = HGetVol(nil, &vRefNum, &dirID);
  781. >    not only because it's one call shorter, but also because it's in C   :-)
  782. > Ah, but you+ll get a wdRefNum in the vRefNum parameter, so you can't
  783. > use that for testing which volume you're on. You still have to
  784. > convert the wdRefNum to a vRefNum/dirID pair and discard the dirID
  785. > from that conversion.
  786.  
  787. Urp. I forgot about that. Well, how about letting me scrape together any last
  788. shreds of dignity by suggesting calling PBHGetVol (I never make high-level calls
  789. anyway). That way, you can look at the ioWDVRefNum field to get the real
  790. vRefNum.
  791.  
  792. - --
  793. Keith Rollin
  794. Phantom Programmer
  795. Taligent, Inc.
  796.  
  797. ---------------------------
  798.  
  799. From: siegel@world.std.com (Rich Siegel)
  800. Subject: ics#/ics4/ics8 in menus
  801. Date: 5 May 92 00:33:59 GMT
  802. Organization: GCC Technologies
  803.  
  804. I know that by putting the appropriate value in the itemCmd field, a 'sicn'
  805. resource can be made to appear next to a specific menu item; I have this
  806. working fine. However, does there exist a similar mechanism to convince the
  807. system to place small color icons next to items, such as it does for the
  808. System 7 Apple menu and application switch menu?
  809.  
  810. Rich
  811.  
  812. - -- 
  813. - -----------------------------------------------------------------------
  814. Rich Siegel                              Internet: siegel@world.std.com
  815. Software Engineer, Quickdraw Group
  816. GCC Technologies
  817.  
  818. +++++++++++++++++++++++++++
  819.  
  820. From: alexr@apple.com (Alexander M. Rosenberg)
  821. Date: 8 May 92 20:15:41 GMT
  822. Organization: Hackers Anonymous
  823.  
  824. In article <Bnr5Kp.75M@world.std.com>, siegel@world.std.com (Rich Siegel) writes:
  825. > I know that by putting the appropriate value in the itemCmd field, a 'sicn'
  826. > resource can be made to appear next to a specific menu item; I have this
  827. > working fine. However, does there exist a similar mechanism to convince the
  828. > system to place small color icons next to items, such as it does for the
  829. > System 7 Apple menu and application switch menu?
  830. > Rich
  831.  
  832. Yes. It isn't documented. It isn't likely to be. Unfortunately, it wasn't ever
  833. designed as something that would be used outside of Apple.
  834.  
  835. - ---------------------------------------------------------------------------
  836. - -  Alexander M. Rosenberg  - INTERNET: alexr@apple.com      - Yoyodyne    -
  837. - -  330 Waverley St., Apt B - UUCP:ucbvax!apple!alexr        - Propulsion  -
  838. - -  Palo Alto, CA 94301     -                                - Systems     -
  839. - -  (415) 329-8463          - Nobody is my employer so       - :-)         -
  840. - -  (408) 974-3110          - nobody cares what I say.       -             -
  841.  
  842. +++++++++++++++++++++++++++
  843.  
  844. From: jpugh@apple.com (Jon Pugh)
  845. Date: 8 May 92 20:00:41 GMT
  846. Organization: Apple Co.
  847.  
  848. In article <Bnr5Kp.75M@world.std.com>, siegel@world.std.com (Rich Siegel) writes:
  849. > I know that by putting the appropriate value in the itemCmd field, a 'sicn'
  850. > resource can be made to appear next to a specific menu item; I have this
  851. > working fine. However, does there exist a similar mechanism to convince the
  852. > system to place small color icons next to items, such as it does for the
  853. > System 7 Apple menu and application switch menu?
  854.  
  855. The System MDEF uses cicn resources if they are present in favor of ICON
  856. resources.  You can create small cicn resources since cicns are of variable
  857. size.  Thus, do the same thing you would for an ICON but provide a small
  858. cicn of the same id instead.
  859.  
  860. Of course, this only works on color systems and on b&w systems you get the
  861. ICON resource, I think.  Come to think of it, I haven't used a 68000 in 
  862. quite some time.  Maybe I do need a PB 100 for testing...
  863.  
  864. Jon
  865.  
  866. ---------------------------
  867.  
  868. From: leue@crd.ge.com (Bill Leue)
  869. Subject: Tech Note or Other Apple Doc on MIDI
  870. Date: 8 May 92 15:55:14 GMT
  871. Organization: General Electric Research & Development
  872.  
  873. Was there ever a TechNote or otehr document from Apple about
  874. MIDI?  I've looked through my TechNotes index but can't find
  875. anything.
  876.  
  877. Thanks!
  878.  
  879. - -Bill Leue
  880. leue@crd.ge.com
  881.  
  882. +++++++++++++++++++++++++++
  883.  
  884. From: Jim Cook <J.Cook@ENS.Prime.COM>
  885. Organization: Prime Computer, Inc.
  886. Date: Fri, 8 May 1992 17:02:37 GMT
  887.  
  888. In article <1992May8.155514.11678@crd.ge.com> leue@crd.ge.com (Bill Leue)
  889. writes:
  890. >Was there ever a TechNote or otehr document from Apple about
  891. >MIDI?  I've looked through my TechNotes index but can't find
  892. >anything.
  893. >
  894. >Thanks!
  895. >
  896. >-Bill Leue
  897. >leue@crd.ge.com
  898. >
  899. There is the Apple MIDI software and documentation available from ADPA.
  900. Perhaps this is what you are thinking of.
  901.  
  902. J
  903.  
  904.  
  905.  
  906. ---------------------------
  907.  
  908. From: ianf@cs.adelaide.edu.au (Ian Florance)
  909. Subject: AppleEvents and TCL
  910. Date: 5 May 92 01:21:01 GMT
  911. Organization: Comp Sci, Uni of Adelaide, Australia
  912.  
  913. I am sending this on behalf of a friend but you can send followups as per
  914. normal...... 
  915.  
  916.  
  917. I am writing a DNA sequence analysis program to teach myself TCL/Macintosh
  918. programming. I am having problems with AppleEvents; when my application
  919. starts it displays an about box title screen, to update the screen while
  920. doing this I call TCL's CApplication::Process1Event.
  921. However this routine intercepts the 'oapp' AppleEvent and creates a new
  922. document on top of my about box, so my about box has to intercept the
  923. AppleEvents before the application does (no problem so far just add in a
  924. DoAppleEvent method to the About box class). The problem is that I can dispose
  925. of the Apple Event, but I want the about box to repost them, effectively just
  926. deferrin the events so that the application does all the required events if it
  927. is called on by another application etc. How do I keep track of the intercepted
  928. events to re-broadcast them.
  929. Also does anyone have a decent implimentation of general 3D graphic view system
  930. (my sequence analysis program requires 3D graphics for some of it's functions).
  931.  
  932. Thanks... Daniel Kortschak ;-)
  933.  
  934.  
  935. ___________________________________________           _--_|\
  936. Ian Florance         Phone : +6 18 228 5502          /      \ 
  937. The Univeristy of Adelaide Apple Consortium          \_.--*_/
  938. University of Adelaide,     South Australia                v
  939.  
  940. +++++++++++++++++++++++++++
  941.  
  942. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  943. Date: 6 May 92 18:58:45 GMT
  944. Organization: Royal Institute of Technology, Stockholm, Sweden
  945.  
  946. .edu.au> ianf@cs.adelaide.edu.au (Ian Florance) writes:
  947.  
  948.    I am writing a DNA sequence analysis program to teach myself TCL/Macintosh
  949.    programming. I am having problems with AppleEvents; when my application
  950.    starts it displays an about box title screen, to update the screen while
  951.    doing this I call TCL's CApplication::Process1Event.
  952.    However this routine intercepts the 'oapp' AppleEvent and creates a new
  953.    document on top of my about box, so my about box has to intercept the
  954.  
  955.  
  956. You could override CApplication::Process1Event in your own code to
  957. not accept high-level events under certain conditions.
  958.  
  959. - -- 
  960. h++ - new and improved !
  961.  
  962. "It's simple. Some people have braces in their names, and some don't. You'll
  963.    just have to accept it the way it is." - Me: h+@nada.kth.se; Jon W{tte
  964.  
  965. +++++++++++++++++++++++++++
  966.  
  967. From: jpugh@apple.com (Jon Pugh)
  968. Date: 8 May 92 19:56:58 GMT
  969. Organization: Apple Co.
  970.  
  971. In article <7025@sirius.ucs.adelaide.edu.au>, ianf@cs.adelaide.edu.au (Ian Florance) writes:
  972. > I am writing a DNA sequence analysis program to teach myself TCL/Macintosh
  973. > programming. I am having problems with AppleEvents; when my application
  974. > starts it displays an about box title screen, to update the screen while
  975. > doing this I call TCL's CApplication::Process1Event.
  976. > However this routine intercepts the 'oapp' AppleEvent and creates a new
  977. > document on top of my about box, so my about box has to intercept the
  978. > AppleEvents before the application does (no problem so far just add in a
  979. > DoAppleEvent method to the About box class). The problem is that I can dispose
  980. > of the Apple Event, but I want the about box to repost them, effectively just
  981. > deferrin the events so that the application does all the required events if it
  982. > is called on by another application etc. How do I keep track of the intercepted
  983. > events to re-broadcast them.
  984. > Also does anyone have a decent implimentation of general 3D graphic view system
  985. > (my sequence analysis program requires 3D graphics for some of it's functions).
  986.  
  987. You are making this too difficult, although so is TCL since they made some
  988. dopey use of the 'oapp' event.
  989.  
  990. Only put up a splash screen if the application is launched, not if a document 
  991. is opened. This more completely defines when your splash occurs.  This also
  992. means you should only put your splash screen up as a _result_ of the oapp, so
  993. you would avoid this problem completely.
  994.  
  995. To do this, you have to override CApplication::DoAppleEvent.
  996.  
  997. I personally believe that DoAppleEvent should call StartupAction and you 
  998. should override that, but I didn't write the damned thing. ;)
  999.  
  1000. Jon
  1001.  
  1002. ---------------------------
  1003.  
  1004. From: michaelh@Xenon.Stanford.EDU (Mike Hennahane)
  1005. Subject: Drag and Drop onto a document?
  1006. Date: 5 May 92 08:57:58 GMT
  1007. Organization: CS Department, Stanford University, California, USA
  1008.  
  1009.  
  1010. If the proper FREF resource is put into a document, will it be able to
  1011. handle apple events? I was wondering about this with regards to the
  1012. following idea:
  1013.  
  1014. I am using 4th Dimension, which can handle apple events when it is
  1015. running through the use of external code resources (essentially
  1016. XCMDs). I would like to be able to drop a TEXT file onto the structure
  1017. file icon of the currently open database, and have the data in the
  1018. TEXT file imported automatically.
  1019.  
  1020. Does this sound at all possible?
  1021.  
  1022. Another (silly) example of this idea: I have a document open in Word.
  1023. I drop a TEXT file onto the icon of the open document.  The TEXT file
  1024. is appended onto my open document (yes, magically, since Word has no
  1025. external code capability).
  1026.  
  1027. If possible, email me a copy of any followup article you post, since I
  1028. don't have the luxury of reading this forum often (except digested [ick]).
  1029.  
  1030. - --mike
  1031. michaelh@cs.stanford.edu
  1032.  
  1033. +++++++++++++++++++++++++++
  1034.  
  1035. From: Jeremiah.Blatz@dartmouth.edu (Jeremiah Blatz)
  1036. Date: 7 May 92 23:23:53 GMT
  1037. Organization: Dartmouth College, Hanover, NH
  1038.  
  1039. System 7 provides no support for drag-and-drop onto documents :-(
  1040.  
  1041. Some ideas I have on this subject are:
  1042.    Make each doc a mini-app that will check to see if it got a
  1043. drag-and-drop and, if so, open its creator and do the needed stuff with
  1044. the document that was dropped onto it. If it didn't get an apple event
  1045. it could just open its creator app and transfer it's (the
  1046. mini-app/document's) data to the creator app. To minimize memory
  1047. useage, the mini-app/doc could be a so-called "faceless app."
  1048.    Write an init to allow drag-and-drop to certain documents.
  1049.  
  1050. Just a thought...
  1051. Jeremiah
  1052.  
  1053. ---------------------------
  1054.  
  1055. End of C.S.M.P. Digest
  1056. **********************
  1057.