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

  1. Received-Date: Sat, 12 Mar 1994 16:36:43 +0100
  2. From: pottier@clipper.ens.fr (Francois Pottier)
  3. Subject: CSMP Digest, issue 2
  4. To: csmp-digest@ens.fr
  5. Date: Sat, 12 Mar 94 16:36:28 MET
  6. X-Mailer: ELM [version 2.3 PL11]
  7. Errors-To: listman@ens.fr
  8. Reply-To: pottier@clipper.ens.fr
  9. X-Sequence: 3
  10.  
  11. C.S.M.P. Digest             Sat, 12 Mar 94       Volume 3 : Issue 2
  12.  
  13. Today's Topics:
  14.  
  15.         Any demo code using PowerPlant out there?
  16.         Converting Str255 to float
  17.         Creating-removing alias files
  18.         Help! Mac Dialog Box Questions
  19.         PackBits for resource compression?
  20.         Problems with serial routines on AV Macs?
  21.         Universal Headers vs. Old Headers
  22.         Using handles to purged-unloaded resources
  23.         Using the serial ports as an input for a SPDT switch.
  24.         WDEF Problems, driving me crazy...
  25.         ZcbFree Goes Negative (Error Number 33)
  26.         any good magazines?
  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 as comp.sys.mac.programmer.src.
  66.  
  67.  
  68. -------------------------------------------------------
  69.  
  70. >From isdvw@wam.umd.edu (Michael R. Tuzi)
  71. Subject: Any demo code using PowerPlant out there?
  72. Date: 24 Feb 1994 19:53:51 GMT
  73. Organization: University of Maryland College Park
  74.  
  75. Can some kind soul out there help me with Powerplant??  I bought the 
  76. Metrowerks CodeWarrior Bronze CD BECAUSE it supposedly came with a 
  77. useful, real C++ class library for handling Macintosh UI items.
  78.  
  79. Up until now, I have been unable to do a damn thing with it since
  80. it requires Resourcerer to create the PObj resources that everything
  81. is built on, and there appears to be NO way to build the class
  82. components any other way. (I know about the constructor, but it is 
  83. SEVERELY limited, in that it can only place the most rudimentary
  84. objects into a window (ie buttons, captions, etc)).
  85.  
  86. If anyone out there has any samples or pieces of code demonstrating
  87. how I can use this thing, I'd appreciate it if you could send me a copy
  88. via email (I'll post a summary if there is any interest.)  Otherwise
  89. I guess I'll have to wait another couple of years until a usable class
  90. library comes along (and don't flame me about Symantec C++ and the TCL;
  91. I have it and can't even get it to run on my 660 :-[).
  92.  
  93. ------------------------------------------------------------------------------
  94. isdvw@wam.umd.edu                  |                #include <innane_saying.h>
  95. ------------------------------------------------------------------------------
  96.  
  97. +++++++++++++++++++++++++++
  98.  
  99. >From keithb@corp.hp.com (Keith Bagley)
  100. Date: 24 Feb 1994 20:27:19 GMT
  101. Organization: Hewlett-Packard
  102.  
  103. In article <2kj0kf$f7n@cville-srv.wam.umd.edu> isdvw@wam.umd.edu (Michael R. Tuzi) writes:
  104. >Can some kind soul out there help me with Powerplant??  I bought the 
  105. >Metrowerks CodeWarrior Bronze CD BECAUSE it supposedly came with a 
  106. >useful, real C++ class library for handling Macintosh UI items.
  107. >
  108. >Up until now, I have been unable to do a damn thing with it since
  109. >it requires Resourcerer to create the PObj resources that everything
  110. >is built on, and there appears to be NO way to build the class
  111. >components any other way. (I know about the constructor, but it is 
  112. >SEVERELY limited, in that it can only place the most rudimentary
  113. >objects into a window (ie buttons, captions, etc)).
  114. >
  115. >If anyone out there has any samples or pieces of code demonstrating
  116. >how I can use this thing, I'd appreciate it if you could send me a copy
  117. >via email (I'll post a summary if there is any interest.)  Otherwise
  118. >I guess I'll have to wait another couple of years until a usable class
  119. >library comes along....                     ^^^^^ 
  120.                          ????? Years ????
  121.  
  122. Uh...isn't CodeWarrior still Alpha/Beta? I just got my Development Release
  123. DR1 a couple of weeks ago. I bought it with the understanding that everything
  124. wasn't finished yet, and won't be finished until May sometime. I don't
  125. speak for Metrowerks (Shoot, I rarely speak for HP! :-)) but I think they're
  126. committed to having full functionality for what they've promised in the
  127. Final Release in May.
  128. I'm not trying to get into your head, but you sound like you feel cheated
  129. in some way; you KNEW the software was pre-release when you bought it.
  130. I doubt seriously that you'll have to wait YEARS for a usable class library.
  131. Even if PowerPlant doesn't suit your needs, there are other native-C++
  132. frameworks (StarView, Zinc, etc...) either here now or almost ready to
  133. ship.
  134.  
  135. Keith
  136.  
  137. +-------------------------------------------------------------------+
  138. |  |\    /|   .---.             |       Keith Bagley                |
  139. |  | \  / |  /        \     /   |       Hewlett-Packard Company     |
  140. |  |  \/  |  \..       \   /    |       Medical Systems Division    |
  141. |  |      |      \      \ /     |       175 Wyman Street            |
  142. |                /       |      |       Waltham, MA                 |
  143. |            ---'        |      |       keithb@hpwarjv.wal.hp.com   |
  144. +-------------------------------------------------------------------+
  145.  
  146.  
  147.  
  148.  
  149. +++++++++++++++++++++++++++
  150.  
  151. >From isdvw@wam.umd.edu (Michael R. Tuzi)
  152. Date: 24 Feb 1994 21:22:12 GMT
  153. Organization: University of Maryland College Park
  154.  
  155.  
  156. ( Tried to mail this to you, but our mailer bounced it back. )
  157.  
  158. Keith:
  159.  
  160. If I sounded like I was whining, that was not my intent.  I realized
  161. when I purchased CodeWarrior that it was a alpha/beta release and as
  162. such, some things would not be available.  I didn't expect that the
  163. framework would be completely unusable. (Alpha/Beta to me means that
  164. the basic functionality of the program is in place, but bugs need to
  165. be worked out and missing features need to be added).  If it was 
  166. necesssary for a developer to buy another piece of software to use
  167. this product, at least we could have been warned in advance (then I'd've
  168. waited rather than frustrate myself even further).
  169.  
  170. It appears to me from looking at the framework that it has a sound
  171. conceptual base, but without docs/examples/or the constructor, it
  172. cannot be used.  Maybe I'm being pessimistic, but I think it will be
  173. difficult for MW to get Powerplant ready for commercial release by the
  174. time they've stated.
  175.  
  176. As for the years of waiting for a usable class library, I've already
  177. waited several (from the time that TCL came out, until the announcement
  178. of Powerplant :-)).  
  179.  
  180. I sincerely hope that I'm wrong on this, because the sole reason that 
  181. I purchased CW was to get Powerplant. I'd be severely disappointed to
  182. have wasted another $200 on a development environment I can't use a la
  183. TCL.
  184.  
  185. +++++++++++++++++++++++++++
  186.  
  187. >From gdl@stlawrence.maths (Mr_G._Landweber_student_tel_2-73550)
  188. Date: 24 Feb 1994 23:20:13 GMT
  189. Organization: (none)
  190.  
  191.    In article <2kj0kf$f7n@cville-srv.wam.umd.edu> isdvw@wam.umd.edu (Michael R. Tuzi) writes:
  192.    >Can some kind soul out there help me with Powerplant??  I bought the 
  193.    >Metrowerks CodeWarrior Bronze CD BECAUSE it supposedly came with a 
  194.    >useful, real C++ class library for handling Macintosh UI items.
  195.    >
  196.    >Up until now, I have been unable to do a damn thing with it since
  197.    >it requires Resourcerer to create the PObj resources that everything
  198.    >is built on, and there appears to be NO way to build the class
  199.    >components any other way. (I know about the constructor, but it is 
  200.    >SEVERELY limited, in that it can only place the most rudimentary
  201.    >objects into a window (ie buttons, captions, etc)).
  202.  
  203. I saw a demo of Code Warrior and PowerPlant yesterday, and the version
  204. I saw came with a type of "interface builder" whose main purpose was
  205. to construct and edit those "PObj" resources.  I watched the
  206. demonstrator create a dialog box with a number of buttons, text items,
  207. and other controls all in a matter of minutes without having to change
  208. any code.  This was a demo of Code Warrior gold, and it may have been
  209. a more recent release than what you were using.
  210.  
  211. -- Greg
  212.    gdl@maths.ox.ac.uk
  213.  
  214. +++++++++++++++++++++++++++
  215.  
  216. >From jwbaxter@olympus.net (John W. Baxter)
  217. Date: Fri, 25 Feb 1994 00:35:44 -0800
  218. Organization: Internet for the Olympic Peninsula
  219.  
  220. In article <2kj5q4$gqb@cville-srv.wam.umd.edu>, isdvw@wam.umd.edu (Michael
  221. R. Tuzi) wrote:
  222.  
  223. > ( Tried to mail this to you, but our mailer bounced it back. )
  224. > Keith:
  225. > If I sounded like I was whining, that was not my intent.  I realized
  226. > when I purchased CodeWarrior that it was a alpha/beta release and as
  227. > such, some things would not be available.  I didn't expect that the
  228. > framework would be completely unusable. (Alpha/Beta to me means that
  229. > the basic functionality of the program is in place, but bugs need to
  230. > be worked out and missing features need to be added).  If it was 
  231. > necesssary for a developer to buy another piece of software to use
  232. > this product, at least we could have been warned in advance (then I'd've
  233. > waited rather than frustrate myself even further).
  234.  
  235. It is true that "Constructor" isn't done yet.  It's not true that it is
  236. unusable (although the parts that aren't done clearly can't be used). 
  237. Resourceror is one solution.  So is writing Rez code, which can describe
  238. those resources quite well (and tediously).
  239.  
  240. And...DRn (particularly where n=1) doesn't imply Alpha or Beta...it implies
  241. Development.  Some parts of DR1 are alpha, some are development.
  242. -- 
  243. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  244.    jwbaxter@pt.olympus.net
  245.  
  246. +++++++++++++++++++++++++++
  247.  
  248. >From d88-jwa@mumrik.nada.kth.se (Jon Wdtte)
  249. Date: 25 Feb 1994 15:30:28 GMT
  250. Organization: Royal Institute of Technology, Stockholm, Sweden
  251.  
  252. >> If I sounded like I was whining, that was not my intent.  I realized
  253. >> when I purchased CodeWarrior that it was a alpha/beta release and as
  254. >> such, some things would not be available.  I didn't expect that the
  255. >> framework would be completely unusable. (Alpha/Beta to me means that
  256. >> the basic functionality of the program is in place, but bugs need to
  257.  
  258. No. The only thing labelled as Alpha is the C compiler; the
  259. framework and C++ compilers are labelled as development versions.
  260. The usual designation for d/a/b/fc is that:
  261. "d" shouldn't really get outside of development, or an initiated QC
  262.     department
  263. "a" is a version where what's in there is as debugged as the programmers
  264.     can make it, but still not feature complete
  265. "b" is where you are almost feature-complete, QC has had a whack at it,
  266.     and it's time for a more general public and diverse usage situations
  267.     to take over testing.
  268. "fc" is when you're trying to get it out the door, and want to have a
  269.    safety line on to guard against things slipping through the cracks.
  270.    Usually it works like "when fc has gone a week without complaints,
  271.    we ship it without further changes."
  272.  
  273. So, you got what you bought (some d and a releases) and I think it's
  274. been a terriffic value; porting from SC++ to CW was SO much faster
  275. thanks to the fast re-compile time; then going to the Apple SDK for
  276. actual code production was not so painful since CW took care of 99%
  277. of the conversion process.
  278.  
  279. -- 
  280.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  281.  Obsolete (n) - dependable, affordable, readily available
  282.  Support trailing-edge technology!
  283.                     -- Bruce H. McIntosh
  284.  
  285. +++++++++++++++++++++++++++
  286.  
  287. >From philip@world.std.com (Philip Borenstein)
  288. Date: Fri, 25 Feb 1994 18:41:28 GMT
  289. Organization: (none)
  290.  
  291. isdvw@wam.umd.edu (Michael R. Tuzi) writes:
  292.  
  293. >Can some kind soul out there help me with Powerplant??  I bought the 
  294. >Metrowerks CodeWarrior Bronze CD BECAUSE it supposedly came with a 
  295. >useful, real C++ class library for handling Macintosh UI items.
  296.  
  297. >Up until now, I have been unable to do a damn thing with it since
  298. >it requires Resourcerer to create the PObj resources that everything
  299. >is built on, and there appears to be NO way to build the class
  300. >components any other way.
  301.  
  302. Unfortunately, the PObj format can't be descriped in Rez. DR2 will use a 
  303. slightly different format that's Rez-able. Even as we speak, Greg Dow is 
  304. writing constructors that let you build UI objects on the fly.
  305.  
  306. Hold on.
  307.  
  308. --philip.
  309.   philip@world.std.com
  310.  
  311.  
  312. +++++++++++++++++++++++++++
  313.  
  314. >From dougw@astro.as.arizona.edu (Doug Williams)
  315. Date: 25 Feb 1994 19:59:29 GMT
  316. Organization: University of Arizona, Tucson, AZ
  317.  
  318. isdvw@wam.umd.edu (Michael R. Tuzi) writes:
  319.  
  320. >Can some kind soul out there help me with Powerplant??  I bought the 
  321. >Metrowerks CodeWarrior Bronze CD BECAUSE it supposedly came with a 
  322. >useful, real C++ class library for handling Macintosh UI items.
  323.  
  324. >Up until now, I have been unable to do a damn thing with it since
  325. >it requires Resourcerer to create the PObj resources that everything
  326. >is built on, and there appears to be NO way to build the class
  327. >components any other way.
  328.  
  329.  
  330. A similar problem is keeping me from buying CodeWarrior as well: the huge
  331. amounts of PD code written in ThinkC. I have seen the BareBones converter
  332. program (ThinkC project -> CodeWarrior), but wonder how much of the _code_ out
  333. there is somehow ThinkC dependent.  Has anyone successfully compiled the
  334. WinterShell, TransSkel, or MacStarter projects under CodeWarrior?  If so, what
  335. changes (if any) had to be made to the code?  If the changes turn out to be
  336. minimal or (overly optimistically) nonexistant, I'll order CodeWarrior right
  337. after I get my CDRom drive.
  338.  
  339.     For example, the code fragment recently posted by Robert Mah about how
  340. to write mixed 68K C, PowerPC C and 68K assembly in both the Metrowerks and
  341. Symantec environments showed that the environments are very close, but not
  342. exactly the same.
  343.  
  344.  
  345. I'll try to summarize any info that comes my way, but I obviously won't be
  346. able to test any CodeWarrior code.
  347.  
  348. Doug Williams
  349. dougw@as.arizona.edu
  350.  
  351. no .sig
  352.  
  353. +++++++++++++++++++++++++++
  354.  
  355. >From E.J. Draper <draper@odin.mda.uth.tmc.edu>
  356. Date: 25 Feb 1994 22:59:25 GMT
  357. Organization: U.T.M.D. Anderson Cancer Center
  358.  
  359. In article <2kllb1$peh@auggie.CCIT.Arizona.EDU> Doug Williams,
  360. dougw@astro.as.arizona.edu writes:
  361. >    For example, the code fragment recently posted by Robert Mah about how
  362. >to write mixed 68K C, PowerPC C and 68K assembly in both the Metrowerks
  363. and
  364. >Symantec environments showed that the environments are very close, but
  365. not
  366. >exactly the same.
  367.  
  368. Why is that such a big deal?  THINK/Sym C and MPW C have always been
  369. different.
  370.  
  371. IMHO, if someone is unable/unwilling to modify a code snippet to suit the
  372. needs of their preferred compiler, they should think twice before using
  373. the snippet.
  374.  
  375.  
  376.       |E|J-  ED DRAPER
  377.  rEpar|D|<-  Radiologic/Pathologic Institute
  378.              The University of Texas M.D. Anderson Cancer Center
  379.              draper@utmdacc.mda.uth.tmc.edu
  380.  
  381. ---------------------------
  382.  
  383. >From ribtm@ttacs.ttu.edu (Greg Vaughn)
  384. Subject: Converting Str255 to float
  385. Date: Wed, 23 Feb 94 15:37:57 GMT
  386. Organization: Insulator Lab Texas Tech U. Physics
  387.  
  388. I'm looking for a way to convert and editable text item in a dialog box,
  389. which is read as a Str255 into a float (actually a double, but I can
  390. typecast that from a float) to use in calculations. Has anyone seen any
  391. code snippet that will do this in C? I'd appreciate any pointers anyone
  392. might have.
  393.  
  394.    ______
  395.   /\__  _\                  | Greg Vaughn
  396.   \/_/\ \/  exas            | Grad Student, Dept. of Physics
  397.      \ \_\  ech University  | Insulator Research Laboratory
  398.       \/_/  Lubbock, Texas  | E-Mail: ribtm@ttacs.ttu.edu
  399.  
  400. +++++++++++++++++++++++++++
  401.  
  402. >From scott.m.silver@dartmouth.edu (Scott M. Silver)
  403. Date: 23 Feb 1994 21:47:07 GMT
  404. Organization: Dartmouth College - Hanover, NH
  405.  
  406. In article <ribtm-230294093635@scm41-2.phys.ttu.edu>
  407. ribtm@ttacs.ttu.edu (Greg Vaughn) writes:
  408.  
  409. > I'm looking for a way to convert and editable text item in a dialog box,
  410. > which is read as a Str255 into a float (actually a double, but I can
  411. > typecast that from a float) to use in calculations. Has anyone seen any
  412. > code snippet that will do this in C? I'd appreciate any pointers anyone
  413. > might have.
  414.  
  415. The way I usually do this is do a P2CStr, and then atof (convert ascii
  416. to float), or atod (convet ascii to double). In english: Convert to a
  417. CStr, and then use ANSI library functions to convert it into the right
  418. kind of number.  
  419.  
  420. I remember a while back a threads flaming everyone about ineffieciency
  421. etc.  This is just one simple way of doing it.  
  422.  
  423. Scott
  424. ____________________________________________________________________
  425. Scott Silver            Dartmouth College                Hanover, NH
  426.  
  427. +++++++++++++++++++++++++++
  428.  
  429. >From resnick@cogsci.uiuc.edu (Pete Resnick)
  430. Date: Wed, 23 Feb 1994 17:52:01 -0600
  431. Organization: University of Illinois at Urbana-Champaign
  432.  
  433. In article <ribtm-230294093635@scm41-2.phys.ttu.edu>, ribtm@ttacs.ttu.edu
  434. (Greg Vaughn) wrote:
  435.  
  436. >I'm looking for a way to convert and editable text item in a dialog box,
  437. >which is read as a Str255 into a float (actually a double, but I can
  438. >typecast that from a float) to use in calculations. Has anyone seen any
  439. >code snippet that will do this in C? I'd appreciate any pointers anyone
  440. >might have.
  441.  
  442. The best way to do it is use FormatStr2X, especially if you are taking the
  443. input from a dialog box. The nice thing about FormatStr2X is that it even
  444. works in funky foreign language scripts like Chinese. To use the routine,
  445. you must pass it not only the Str255 that you want converted, but also the
  446. results of the Str2Format routine and the GetItlTable routine. The
  447. documentation is generally poor, so I'll describe the parameters and give
  448. you a code example below. Here's what you pass to FormatStr2X:
  449.  
  450. source:       Obviously the string representation of the number.
  451.  
  452. myCanonical:  This is simply the format that you expect the number to be.
  453.               For example, if you wanted a positive integer with up to
  454.               3 decimal places, you would want the format to be "###".
  455.               The "#" symbol means a non-zero filled digit, whereas a
  456.               "0" would mean zero filled. If you wanted an floating point
  457.               exponential notation with up to 2 digit integer portion,
  458.               exactly 2 digit decimal portion, and exactly 1 digit after
  459.               the "E", your format would be "##.00E+0". In a format
  460.               string, you can put the format for a positive value, a
  461.               negative value, and 0 seperated by semicolons:
  462.                      ##.00E+0;-##.00E+0;0.00E+0
  463.  
  464.               But myCanonical is not the format string itself, but is an
  465.               internal format that you get from calling Str2Format. This
  466.               is so you can store the format returned to you by Str2Format
  467.               and use it on different international systems.
  468.  
  469. partsTable:   The number parts table from the 'itl4' resource. If you are
  470.               using System 7 or later, you can simply call IUGetItlTable,
  471.               asking it for the number parts table. You don't need to
  472.               worry about HLock'ing itlHandle because FormatStr2X doesn't
  473.               move memory; just don't do anything between your call to
  474.               IUGetItlTable and the FormatStr2X routine. If you are using
  475.               System 6, you need to perform the IUGetItlTable by hand.
  476.               It's a few lines of code; if need it, I can write up some
  477.               code. The extended number to put the thing into. Most C
  478.               compilers will convert it to a float on the fly.
  479.  
  480. So, let's say you expect the user to enter a string containing up to 5
  481. digits in the integer with a thousand marker between the 3rd and fourth
  482. digit, exactly two digits after the decimal, put it in parenthesis if it's
  483. negative, and have it just be "0.00" if it's 0. (I will use "." for the
  484. decimal and "," for the thousand marker.) Here's the C code (passing in
  485. the source string):
  486.  
  487. Handle itlHandle;             /* The 'itl4' resource handle */
  488. long offset, length;          /* Offset and length of parts table */
  489. NumFormatString myCanonical;  /* Canonical format */
  490. extended x;                   /* The number to put it into */
  491.  
  492. IUGetItlTable(iuCurrentScript, iuNumberPartsTable,
  493.               &itlHandle, &offset, &length);
  494. Str2Format("\p##,###.00;(##,###.00);0.00",
  495.            (NumberParts *)(*itlHandle + offset),
  496.            &myCanonical);
  497. FormatStr2X(source, &myCanonical,
  498.             (NumberParts *)(*itlHandle + offset), &x);
  499.  
  500. The FormatStr2X routines will return a result that will tell you if there
  501. are any parsing errors and to what level of confidence it thinks it parsed
  502. it correctly.
  503.  
  504. pr
  505. -- 
  506. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  507. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  508. System manager - Cognitive Science Group, Beckman Institute, UIUC
  509. Internet: resnick@cogsci.uiuc.edu
  510.  
  511. +++++++++++++++++++++++++++
  512.  
  513. >From resnick@cogsci.uiuc.edu (Pete Resnick)
  514. Date: Wed, 23 Feb 1994 17:31:21 -0600
  515. Organization: University of Illinois at Urbana-Champaign
  516.  
  517. In article <ribtm-230294093635@scm41-2.phys.ttu.edu>, ribtm@ttacs.ttu.edu
  518. (Greg Vaughn) wrote:
  519.  
  520. >I'm looking for a way to convert and editable text item in a dialog box,
  521. >which is read as a Str255 into a float (actually a double, but I can
  522. >typecast that from a float) to use in calculations. Has anyone seen any
  523. >code snippet that will do this in C? I'd appreciate any pointers anyone
  524. >might have.
  525.  
  526. The best way to do it is use FormatStr2X, especially if you are taking the
  527. input from a dialog box. The nice thing about FormatStr2X is that it even
  528. works in funky foreign language scripts like Chinese. To use the routine,
  529. you must pass it not only the Str255 that you want converted, but also the
  530. results of the Str2Format routine and the GetItlTable routine. The
  531. documentation is generally poor, so I'll describe the parameters and give
  532. you a code example below. Here's what you pass to FormatStr2X:
  533.  
  534. source:       Obviously the string representation of the number.
  535.  
  536. myCanonical:  This is simply the format that you expect the number to be.
  537.               For example, if you wanted a positive integer with up to
  538.               3 decimal places, you would want the format to be "###".
  539.               The "#" symbol means a non-zero filled digit, whereas a
  540.               "0" would mean zero filled. If you wanted an floating point
  541.               exponential notation with up to 2 digit integer portion,
  542.               exactly 2 digit decimal portion, and exactly 1 digit after
  543.               the "E", your format would be "##.00E+0". In a format
  544. string,
  545.               you can put the format for a positive value, a negative
  546. value,
  547.               and 0 seperated by semicolons: "##.00E+0;-##.00E+0;0.00E+0"
  548.  
  549.               But myCanonical is not the format string itself, but is an
  550.               internal format that you get from calling Str2Format. This
  551.               is so you can store the format returned to you by Str2Format
  552.               and use it on different international systems.
  553.  
  554. partsTable:   The number parts table from the 'itl4' resource. If you are
  555.               using System 7 or later, you can simply call IUGetItlTable,
  556.               asking it for the number parts table. You don't need to
  557.               worry about HLock'ing itlHandle because FormatStr2X doesn't
  558.               move memory; just don't do anything between your call to
  559.               IUGetItlTable and the FormatStr2X routine. If you are using
  560.               System 6, you need to perform the IUGetItlTable by hand.
  561. It's
  562.               a few lines of code; if need it, I can write up some code.
  563.  
  564. x:            The extended number to put the thing into. Most C compilers
  565.               will convert it to a float on the fly.
  566.  
  567. So, let's say you expect the user to enter a string containing up to 5
  568. digits in the integer with a thousand marker between the 3rd and fourth
  569. digit, exactly two digits after the decimal, put it in parenthesis if it's
  570. negative, and have it just be "0.00" if it's 0. (I will use "." for the
  571. decimal and "," for the thousand marker.) Here's the C code (passing in
  572. the source string):
  573.  
  574. Handle itlHandle;             /* The 'itl4' resource handle */
  575. long offset, length;          /* Offset and length of number parts table
  576. */
  577. NumFormatString myCanonical;  /* Canonical format */
  578. extended x;                   /* The number to put it into */
  579.  
  580. IUGetItlTable(iuCurrentScript, iuNumberPartsTable,
  581.               &itlHandle, &offset, &length);
  582. Str2Format("\p##,###.00;(##,###.00);0.00",
  583.            (NumberParts *)(*itlHandle + offset),
  584.            &myCanonical);
  585. FormatStr2X(source, &myCanonical, (NumberParts *)(*itlHandle + offset),
  586. &x);
  587.  
  588. The FormatStr2X routines will return a result that will tell you if there
  589. are any parsing errors and to what level of confidence it thinks it parsed
  590. it correctly.
  591.  
  592. pr
  593. -- 
  594. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  595. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  596. System manager - Cognitive Science Group, Beckman Institute, UIUC
  597. Internet: resnick@cogsci.uiuc.edu
  598.  
  599. +++++++++++++++++++++++++++
  600.  
  601. >From u9119523@sys.uea.ac.uk (Graham Cox)
  602. Date: Thu, 24 Feb 1994 15:34:41 GMT
  603. Organization: School of Information Systems, UEA, Norwich
  604.  
  605. In article <resnick-230294173121@colt-42.slip.uiuc.edu>,
  606. resnick@cogsci.uiuc.edu (Pete Resnick) wrote:
  607.  
  608. > In article <ribtm-230294093635@scm41-2.phys.ttu.edu>, ribtm@ttacs.ttu.edu
  609. > (Greg Vaughn) wrote:
  610. > >I'm looking for a way to convert and editable text item in a dialog box,
  611. > >which is read as a Str255 into a float (actually a double, but I can
  612.  
  613. Why not just use SANE's Str2Num procedure?
  614.  
  615. --------------------------------------------------------------------------
  616. Love & BSWK, Graham
  617.  
  618. -Everyone is entitled to their opinion, no matter how wrong they may be...
  619. --------------------------------------------------------------------------
  620.  
  621. ---------------------------
  622.  
  623. >From DAVISM@kcgl1.eng.ohio-state.edu (Mike Davis, Chief of Operations -- KCGL)
  624. Subject: Creating-removing alias files
  625. Date: 24 Feb 1994 23:33:41 GMT
  626. Organization: The Ohio State University
  627.  
  628.  
  629.     I would very much like to create and remove an alias file on the
  630. desktop via a program.  The basic idea is to provide a hint to the current
  631. Mac user that (s)he needs to disconnect from a service by displaying an alias
  632. to the program which allows him/her to (dis)connect with his/her name instead
  633. of "program-name alias".  When the user does disconnect, the alias file is
  634. removed from the desktop.  I've looked through a number of (N)IM volumes, but
  635. all I can find reference to are alias _records_ and manipulating same.
  636. Apparently, creating alias _files_ isn't recommended, but I'd like to do it
  637. anyway (;-), unless someone can offer a better method of constantly notifying
  638. the user that (s)he needs to disconnect before leaving the Mac.
  639.  
  640.                             Thanks,
  641.                              Mike
  642. --
  643.  Internet: davism@KCGL1.eng.ohio-state.edu |
  644.             -or- DAVISM+@osu.edu           |   These Thoughts, They Be Mine
  645.    BITNET: DAVISM+@OHSTMAIL.BITNET         |
  646.  
  647. +++++++++++++++++++++++++++
  648.  
  649. >From jpmah@undergrad.math.uwaterloo.ca (John Mah)
  650. Date: Fri, 25 Feb 1994 02:51:02 GMT
  651. Organization: University of Waterloo
  652.  
  653. Basically, you want to create a resource file of type 'alis' & creator 'fndr', 
  654. stuff a AliasHandle (generated by a call to NewAlias()) into a resource of
  655. type 'alis' with resource ID of 0. Make sure to set the 'alias' bundle bit of 
  656. the created file.
  657.  
  658. Here's a sample code snippet taken from one of my programs (adjust to suit
  659. to your tastes):
  660.  
  661. ---- begin snippet ----
  662.  
  663.     AliasHandle    hArticle;
  664.     OSErr        err;
  665.     FInfo        fndrInfo;
  666.     FSSpec        articleSpec;
  667.     short        refNum;
  668.     FSSpec        newsFolderFS;
  669.  
  670.         // Create minimal alias for the original article.
  671.  
  672.     newsFolderFS.vRefNum = gSpoolFolder->fldrVRefNum;
  673.     newsFolderFS.parID = gSpoolFolder->fldrDirID;
  674.     newsFolderFS.name[0] = '\0';
  675.  
  676.     err = NewAlias( &newsFolderFS, theSpec, &hArticle );
  677.     if ( !hArticle || err != noErr ) {
  678.         LogError( "Could not allocate alias for article!" );
  679.         return;
  680.     }
  681.  
  682.         // Setup the article file, initialize it and specify where it is
  683.         // supposed to be put. If it exists, then delete it.
  684.  
  685.     FSMakeFSSpec( gSpoolFolder->fldrVRefNum, entry->dirID, 
  686.         (StringPtr) articleNumber, &articleSpec );
  687.     FSpCreateResFile( &articleSpec, 'fndr', 'alis', 0 );
  688.     err = ResError();
  689.     if ( err == dupFNErr ) {
  690.         err = FSpDelete( &articleSpec );
  691.         FSpCreateResFile( &articleSpec, 'fndr', 'alis', 0 );
  692.         err = ResError();
  693.     }
  694.     if ( err != noErr ) {
  695.         LogError( "Couldn't create alias file!" );
  696.         return;
  697.     }
  698.     
  699.         // Create the resource file and open it for writing.
  700.  
  701.     refNum = FSpOpenResFile( &articleSpec, fsWrPerm );    
  702.     if ( refNum == -1 || ResError() != noErr ) {
  703.         LogError( "Couldn't open an alias file!" );
  704.         return;
  705.     }
  706.     
  707.         // Write alias resource to file.
  708.  
  709.     AddResource( (Handle) hArticle, 'alis', 0, "\p" );
  710.     ChangedResource( (Handle) hArticle );
  711.     if ( ResError() == noErr ) {
  712.         WriteResource( (Handle) hArticle );
  713.         HPurge( (Handle) hArticle );
  714.     }
  715.  
  716.     CloseResFile( refNum );
  717.     
  718.         // Now set the "alias" finder bit.
  719.     
  720.     FSpGetFInfo( &articleSpec, &fndrInfo );
  721.     fndrInfo.fdFlags |= (1L << 15);
  722.     FSpSetFInfo( &articleSpec, &fndrInfo );
  723.  
  724. ---- end snippet ----
  725.  
  726. Hope that gives you an idea of how things work.
  727.  
  728. - John
  729.  
  730.  
  731. ---------------------------
  732.  
  733. >From chriss@microware.com (Chris Severtson)
  734. Subject: Help! Mac Dialog Box Questions
  735. Date: Tue, 22 Feb 1994 16:58:10 GMT
  736. Organization: Microware Systems Corp., Des Moines, Iowa
  737.  
  738. I am not sure if this is the correct group to post to, but here goes...
  739.  
  740. Dialog Box Questions:
  741. -------------------
  742. 1) The toolbox call HiliteControl() can be used to dim a control and its
  743. title. I am desperately in search of a way to "dim" statText and editText
  744. dialog items.
  745.  
  746. 2) I am also searching for the answer to this question: I use the call
  747. SetDialogDefaultItem() and HiliteControl() to mark my "OK" button as the
  748. default button and set it to be initially "dim". ModalDialog() hilites this
  749. button even though I "dimmed" it before calling it. After the first time
  750. through the loop though, it will stay dimmed if I dim it again. I think it
  751. has to do with the fact that it is the first call and ModalDialog() has to
  752. draw the window. What I am looking for is a workaround.
  753.  
  754. Any help you can offer is greatly appreciated.  Please email me your
  755. responses.
  756.  
  757. +++++++++++++++++++++++++++
  758.  
  759. >From walkerj@math.scarolina.edu (Jim Walker)
  760. Date: 22 Feb 1994 19:11:31 GMT
  761. Organization: University of South Carolina - Columbia - Computer Science
  762.  
  763. chriss@microware.com (Chris Severtson) writes:
  764.  
  765. >1) The toolbox call HiliteControl() can be used to dim a control and its
  766. >title. I am desperately in search of a way to "dim" statText and editText
  767. >dialog items.
  768.  
  769. I posted some text item dimming source code (THINK C) at the ftp site
  770. bigbird.csd.scarolina.edu, pub/mac.
  771. --
  772.  
  773.  -- Jim Walker  USC Dept. of Math.  walkerj@math.scarolina.edu
  774.  
  775. +++++++++++++++++++++++++++
  776.  
  777. >From rmah@panix.com (Robert S. Mah)
  778. Date: Tue, 22 Feb 1994 16:00:59 -0500
  779. Organization: One Step Beyond
  780.  
  781. chriss@microware.com (Chris Severtson) wrote:
  782.  
  783. > 1) The toolbox call HiliteControl() can be used to dim a control and its
  784. > title. I am desperately in search of a way to "dim" statText and editText
  785. > dialog items.
  786.  
  787. Just draw a 50% gray pattern over the text in srcBic mode.  If you wanna
  788. get fancy and use Color QD, use the blend mode.  Note that, you'll have to
  789. apply these in your filter proc because a screen depth change or an update
  790. on the dialog will cause the item text to redraw itself in 100% black.
  791.  
  792. For finer control, draw the static text using a userItem proc.  If you do
  793. this, and are running only on System 7, you can use the new grayishTextOr
  794. (or something like that) drawing mode to draw diabled text items.
  795.  
  796. Finally, "dimming" editable text items is no harder than static text items.
  797.  However, the primary problem is with making dialog manager skip these
  798. items during the tabbing sequence.
  799.  
  800. I believe there is a code snippet (available on the reference library CD's
  801. and on ftp.apple.com in /dts/mac/sc/snippets/toolbox/, called "Dialog Bits"
  802. by C.K. Haun that illustrates how to do both these things.
  803.  
  804.  
  805. > 2) I am also searching for the answer to this question: I use the call
  806. > SetDialogDefaultItem() and HiliteControl() to mark my "OK" button as the
  807. > default button and set it to be initially "dim". ModalDialog() hilites this
  808. > button even though I "dimmed" it before calling it. After the first time
  809. > through the loop though, it will stay dimmed if I dim it again. I think it
  810. > has to do with the fact that it is the first call and ModalDialog() has to
  811. > draw the window. What I am looking for is a workaround.
  812.  
  813. One way that might work is to open and draw the dialog box offscreen first.
  814.  Then dim the control.  Then move it to the correct location and then start
  815. your ModalDialog loop.  I haven't tried this myself, so take this advice
  816. with a grain of salt.
  817.  
  818. Cheers,
  819. Rob
  820. ________________________________________________________________________
  821.  Robert S. Mah              One Step Beyond              rmah@panix.com
  822.  
  823. +++++++++++++++++++++++++++
  824.  
  825. >From u9119523@sys.uea.ac.uk (Graham Cox)
  826. Date: Fri, 25 Feb 1994 12:44:19 GMT
  827. Organization: School of Information Systems, UEA, Norwich
  828.  
  829. In article <rmah-220294160059@rmah.dialup.access.net>, rmah@panix.com
  830. (Robert S. Mah) wrote:
  831.  
  832. > chriss@microware.com (Chris Severtson) wrote:
  833. > Finally, "dimming" editable text items is no harder than static text items.
  834. >  However, the primary problem is with making dialog manager skip these
  835. > items during the tabbing sequence.
  836.  
  837. You can 'cast' a stat text item to an edit text one and vice versa- the
  838. handle to the item is the same. The dialog manager then automatically skips
  839. the item. However, you have to check before changing the type that it's not
  840. the currently selected item- if it is (by comparing the ID to the value in
  841. the dialog record) then change the selection to another field first. Its
  842. much easier to do than describe- one of my dialogs in MacTriv (archive
  843. sites) illustrates this behaviour. 
  844.  
  845.  
  846.  
  847. --------------------------------------------------------------------------
  848. Love & BSWK, Graham
  849.  
  850. -Everyone is entitled to their opinion, no matter how wrong they may be...
  851. --------------------------------------------------------------------------
  852.  
  853. ---------------------------
  854.  
  855. >From AIKEN <INRA000@MUSICB.MCGILL.CA>
  856. Subject: PackBits for resource compression?
  857. Date: Fri, 25 Feb 1994 02:46:07 GMT
  858. Organization: McGill University
  859.  
  860.     Is PackBits suitable for use as a general-purpose compression
  861. algorithm for data which is known to be highly redundant? THINK
  862. Reference speaks of its use for compressing B&W bitmap images, since
  863. they tend to contain large solid areas, but is there any reason it
  864. couldn't be used for other purposes? How fast is it?
  865.  
  866.     Mark Aiken
  867.     inra@musicb.mcgill.ca
  868.  
  869.  
  870. +++++++++++++++++++++++++++
  871.  
  872. >From mhall@cs.oberlin.edu
  873. Date: 25 Feb 1994 20:23:08 GMT
  874. Organization: Oberlin College
  875.  
  876. In article  <24FEB94.23510214.0070@VM1.MCGILL.CA> AIKEN 
  877. <INRA000@MUSICB.MCGILL.CA> writes: 
  878.  
  879. >     Is PackBits suitable for use as a general-purpose compression
  880. > algorithm for data which is known to be highly redundant? THINK
  881. > Reference speaks of its use for compressing B&W bitmap images, since
  882. > they tend to contain large solid areas, but is there any reason it
  883. > couldn't be used for other purposes? How fast is it?
  884. >     Mark Aiken
  885. >     inra@musicb.mcgill.ca
  886.  
  887. Packbits is also suitable for 8-bit color (PICT's automatically use packbits 
  888. when bitmap information is stored), and I think that there also simple 
  889. compression schemes for 16 and 32 bit color as well.
  890.  
  891. Packbits uses run length encoding to compress data.  That is, if there are 3 or 
  892. more identical BYTES in a row, it will encode into 2 bytes, where the first 
  893. byte is the count (of identical bytes) and the second is the byte itself. (it's 
  894. a little more complex than this, but this is the general idea.  But be aware 
  895. that there is more overhead than just this).  If there are less than three 
  896. identical consecutive bytes, no compression takes place.
  897.  
  898. So, whether or not PackBits is good for your purpose, it  is if you have 
  899. massive repetition of 1,2,4, or 8 bit patterns - and the repetition is 
  900. consecutive.  For text, packbits is pretty useless.  But, it is a general 
  901. routine - it is also lossless (data is preserved exactly) so if you have data 
  902. that fits the above criteria, use it.
  903.  
  904. -matt
  905.  
  906.  
  907. ---------------------------
  908.  
  909. >From ingemar@lysator.liu.se (Ingemar Ragnemalm)
  910. Subject: Problems with serial routines on AV Macs?
  911. Date: Fri, 25 Feb 1994 10:52:59 GMT
  912. Organization: (none)
  913.  
  914.  
  915. I'm posting this for a friend. He has some working serial routines, just
  916. the ordinary stuff. When he used that, in a MacroMedia Director plug-in,
  917. on an AV Mac, it crashed, and so did MacroMedias demo sources. (Their
  918. *compiled* module did work, though, so we guess that is a newer version.)
  919.  
  920. Is there something we need to know when using the serial ports on AV Macs?
  921.  
  922.  
  923. --
  924. ---
  925. Ingemar Ragnemalm, PhD
  926. Image processing, Mac shareware games
  927. E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se
  928.  
  929. +++++++++++++++++++++++++++
  930.  
  931. >From isis@netcom.com (Mike Cohen)
  932. Date: Fri, 25 Feb 1994 18:49:28 GMT
  933. Organization: ISIS International
  934.  
  935. ingemar@lysator.liu.se (Ingemar Ragnemalm) writes:
  936.  
  937.  
  938. >I'm posting this for a friend. He has some working serial routines, just
  939. >the ordinary stuff. When he used that, in a MacroMedia Director plug-in,
  940. >on an AV Mac, it crashed, and so did MacroMedias demo sources. (Their
  941. >*compiled* module did work, though, so we guess that is a newer version.)
  942.  
  943. >Is there something we need to know when using the serial ports on AV Macs?
  944.  
  945. Someone reported that to me. I have some code that opens the serial driver &
  946. it fails on an AV mac. One work around seems to be to use the CTB and the
  947. Serial Tool instead (although you'll proably start getting calls "why doesn't
  948. it work - it says tool not found"). Unfortunately, I don't have access to an
  949. AV for testing right now - my client's building was destroyed last month.
  950.  
  951. >--
  952. >---
  953. >Ingemar Ragnemalm, PhD
  954. >Image processing, Mac shareware games
  955. >E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se
  956. -- 
  957. Mike Cohen - isis@netcom.com
  958. NewtonMail: MikeC49506 / ALink: D6734 / AOL: MikeC20
  959.  
  960.  
  961. +++++++++++++++++++++++++++
  962.  
  963. >From bgoldstein@jplsp2.jpl.nasa.gov (Bruce Goldstein)
  964. Date: Fri, 25 Feb 1994 10:47:57 -0700
  965. Organization: Jet Propulsion Laboratory
  966.  
  967. In article <CLs0wC.FrG@lysator.liu.se>, ingemar@lysator.liu.se (Ingemar
  968. Ragnemalm) wrote:
  969.  
  970. > I'm posting this for a friend. He has some working serial routines, just
  971. > the ordinary stuff. When he used that, in a MacroMedia Director plug-in,
  972. > on an AV Mac, it crashed, and so did MacroMedias demo sources. (Their
  973. > *compiled* module did work, though, so we guess that is a newer version.)
  974. > Is there something we need to know when using the serial ports on AV Macs?
  975. > --
  976. > ---
  977. > Ingemar Ragnemalm, PhD
  978. > Image processing, Mac shareware games
  979. > E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se
  980. You should get the AV Serial Extension (unsupported Apple software).
  981. It is available somewhere on sumex-aim.stanford.edu
  982.  
  983. ---------------------------
  984.  
  985. >From Willie Rauchwerger <willie-rauchwerger@uokhsc.edu>
  986. Subject: Universal Headers vs. Old Headers
  987. Date: 22 Feb 1994 15:38:44 GMT
  988. Organization: OU Health Sciences Center
  989.  
  990. Well, I was in the process of porting my program from
  991. Think C 6.0 to Metrowerks C++ 68k, and I ran into a little
  992. inconsistency with the Universal Header files and the old
  993. Think includes, and when I checked, the old MPW includes.
  994.  
  995. (Note how the the first argument is defined.)
  996.  
  997. In the Think headers, "ToolUtils.h":
  998. pascal void GetIndPattern(Pattern thePat,
  999.                           short patternListID, short index); 
  1000.  
  1001. In the old MPW headers, "ToolUtils.h":
  1002. pascal void GetIndPattern(Pattern thePat,
  1003.                           short patternListID, short index); 
  1004.  
  1005. But in the Metrowerks headers (Apple Universal Headers), "ToolUtil.h":
  1006. extern pascal void GetIndPattern(Pattern *thePat,
  1007.                           short patternListID, short index);
  1008.  
  1009. And the Mac on RISC SDK headers (Apple Universal Headers) "ToolUtil.h":
  1010. extern pascal void GetIndPattern(Pattern *thePat,
  1011.                           short patternListID, short index);
  1012.  
  1013. All of this brings up several questions:
  1014.  
  1015. 1. Is this inconsistency a plain mistake?
  1016. 2. If not, is it because of the PPC C compilers ignoring
  1017.     the pascal keyword calling conventions?
  1018. 3. If so (#2), how do I maintain the same set of source for
  1019.     Think and for Metrowerks?
  1020.     (I can't completely commit to MW, the debugger is too flaky.)
  1021.     
  1022. Help, anyone...thanks.
  1023.  
  1024.  
  1025. Willie Rauchwerger          AppleLink: Willie
  1026. Telemedicine Software Guy   Internet: willie-rauchwerger@uokhsc.edu
  1027. OU Health Sciences Center
  1028.  
  1029. +++++++++++++++++++++++++++
  1030.  
  1031. >From d88-jwa@mumrik.nada.kth.se (Jon Wdtte)
  1032. Date: 23 Feb 1994 07:58:53 GMT
  1033. Organization: Royal Institute of Technology, Stockholm, Sweden
  1034.  
  1035. In <2kd8u4$tv@romulus.ucs.uoknor.edu> Willie Rauchwerger <willie-rauchwerger@uokhsc.edu> writes:
  1036.  
  1037. >In the old MPW headers, "ToolUtils.h":
  1038. >pascal void GetIndPattern(Pattern thePat,
  1039.  
  1040. >But in the Metrowerks headers (Apple Universal Headers), "ToolUtil.h":
  1041. >extern pascal void GetIndPattern(Pattern *thePat,
  1042.  
  1043. >1. Is this inconsistency a plain mistake?
  1044.  
  1045. No. "Pattern" changed from unsigned char[8] to a struct two years ago,
  1046. but Symantec hasn't kept up with that change yet.
  1047. This is a well-documented gotcha when going to the universal headers.
  1048. You will have to fins ALL your pattern references and probably change
  1049. them, including "gray" which is now written "& qd . gray"
  1050.  
  1051. >2. If not, is it because of the PPC C compilers ignoring
  1052. >    the pascal keyword calling conventions?
  1053.  
  1054. Partly that, and partly because the char-array had some unfortunate
  1055. problems.
  1056.  
  1057. >3. If so (#2), how do I maintain the same set of source for
  1058. >    Think and for Metrowerks?
  1059.  
  1060. You make the universal headers work under Think. Good luck!
  1061. -- 
  1062.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  1063.   "And now, from the makers of EDLIN, comes: Windows NT!"
  1064.  
  1065. +++++++++++++++++++++++++++
  1066.  
  1067. >From jbrowne@zaphod.ncsa.uiuc.edu (Jim Browne)
  1068. Date: 24 Feb 94 00:23:02 GMT
  1069. Organization: University of Illinois at Urbana
  1070.  
  1071. d88-jwa@mumrik.nada.kth.se (Jon Wdtte) writes:
  1072.  
  1073. >In <2kd8u4$tv@romulus.ucs.uoknor.edu> Willie Rauchwerger <willie-rauchwerger@uokhsc.edu> writes:
  1074.  
  1075. >>3. If so (#2), how do I maintain the same set of source for
  1076. >>    Think and for Metrowerks?
  1077.  
  1078. >You make the universal headers work under Think. Good luck!
  1079.  
  1080. Do this in your prefix file:
  1081.  
  1082. #ifdef THINK_C
  1083. #define PATTERN(x) x
  1084. #else
  1085. #define PATTERN(X) &x
  1086. #endif
  1087.  
  1088. And then surround your pattern references with PATTERN(   )
  1089.  
  1090.  
  1091. -- 
  1092. Jim Browne                                             | jbrowne@ncsa.uiuc.edu |
  1093. Head NCSA Mac Telnet Hacker, SDG System Administrator  | (217) 244-7798        |
  1094. <a href="http://www.ncsa.uiuc.edu/SDG/People/jbrowne/jbrowne.html">Click me</a>
  1095.  "People can buy HANDGUNS easier." - S. Anichini, on accquiring IMSA yearbooks.
  1096.  
  1097. +++++++++++++++++++++++++++
  1098.  
  1099. >From ramapo@crestone.ssd.kodak.com (Pete Hoch x39699)
  1100. Date: Wed, 23 Feb 1994 15:53:48 GMT
  1101. Organization: Eastman Kodak Company
  1102.  
  1103. Willie Rauchwerger (willie-rauchwerger@uokhsc.edu) wrote:
  1104. : (Note how the the first argument is defined.)
  1105. : In the old MPW headers, "ToolUtils.h":
  1106. : pascal void GetIndPattern(Pattern thePat,
  1107. :                           short patternListID, short index); 
  1108. : But the Mac on RISC SDK headers (Apple Universal Headers) "ToolUtil.h":
  1109. : extern pascal void GetIndPattern(Pattern *thePat,
  1110. :                           short patternListID, short index);
  1111. : All of this brings up several questions:
  1112. : 1. Is this inconsistency a plain mistake?
  1113.  
  1114. This is not a mistake but it does look funny.
  1115.  
  1116. : 2. If not, is it because of the PPC C compilers ignoring
  1117. :     the pascal keyword calling conventions?
  1118. : 3. If so (#2), how do I maintain the same set of source for
  1119. :     Think and for Metrowerks?
  1120.  
  1121. Good guess but wrong.  The original development environment for the
  1122. Macintosh (which ran on the Lisa for you history bufs.)  passed any
  1123. argument which was longer than four bytes by reference.  This is
  1124. why you never see Rect in a toolbox argument call but you allways
  1125. see Rect*.  Since the Pattern structure (which used to be an array)
  1126. is longer than four bytes so it must be passed by reference.  When
  1127. Pattern was declaired as an array this happend for you because of
  1128. the design on the C language.
  1129.  
  1130. Pete
  1131.  
  1132.  
  1133. +++++++++++++++++++++++++++
  1134.  
  1135. >From zobkiw@datawatch.com (joe zobkiw)
  1136. Date: Thu, 24 Feb 1994 18:06:54 GMT
  1137. Organization: Datawatch Corporation
  1138.  
  1139. Getting the new headers to work under THINK is not a big deal. There are
  1140. some exceptions but you can get around them if you need to relatively
  1141. easily. I've uploaded a project to AOL that will help you to use the new
  1142. Universal Headers with THINK C. That is, if you still want to use THINK C
  1143. at all.
  1144.  
  1145. +++++++++++++++++++++++++++
  1146.  
  1147. >From jwbaxter@olympus.net (John W. Baxter)
  1148. Date: Thu, 24 Feb 1994 10:13:57 -0800
  1149. Organization: Internet for the Olympic Peninsula
  1150.  
  1151. In article <CLopHq.JqA@newsserver.pixel.kodak.com>,
  1152. ramapo@crestone.ssd.kodak.com (Pete Hoch x39699) wrote:
  1153.  
  1154. The urgency of the change to Pattern was simple:  the old way led to some
  1155. crashing situations on 68000 Macs, and Pattern should never have been
  1156. defined that way in C.  Too close a copy of the Pascal definition was made
  1157. early on.
  1158.  
  1159. -- 
  1160. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1161.    jwbaxter@pt.olympus.net
  1162.  
  1163. +++++++++++++++++++++++++++
  1164.  
  1165. >From jwbaxter@olympus.net (John W. Baxter)
  1166. Date: Thu, 24 Feb 1994 10:09:57 -0800
  1167. Organization: Internet for the Olympic Peninsula
  1168.  
  1169. In article <2kf2bt$e2b@news.kth.se>, d88-jwa@mumrik.nada.kth.se (Jon Wtte)
  1170. wrote:
  1171.  
  1172. > >3. If so (#2), how do I maintain the same set of source for
  1173. > >    Think and for Metrowerks?
  1174. > You make the universal headers work under Think. Good luck!
  1175. > -- 
  1176.  
  1177. Which implies that the task is harder than it really is.  Pretty good
  1178. instructions on doing the job are included (strangely...the only place I've
  1179. seen them) on the AppleScript 1.1 Developer Kit CD.  [Since AS 1.1 has
  1180. Universalized headers).]
  1181.  
  1182. It was working for me, although I needed to revert to standard (ie, old
  1183. fashioned) Think headers to check something out.  I have a nice StuffIt
  1184. archive with the modern ones.  I don't care much, since I've almost
  1185. entirely switched to CodeWarrior.
  1186.  
  1187. -- 
  1188. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1189.    jwbaxter@pt.olympus.net
  1190.  
  1191. +++++++++++++++++++++++++++
  1192.  
  1193. >From giles@med.cornell.edu (Aaron Giles)
  1194. Date: Thu, 24 Feb 1994 13:55:30 -0500
  1195. Organization: Cornell University Medical College
  1196.  
  1197. In article <cshotton-240294113210@oac2.hsc.uth.tmc.edu>,
  1198. cshotton@oac.hsc.uth.tmc.edu (Chuck Shotton) wrote:
  1199.  
  1200. > > >3. If so (#2), how do I maintain the same set of source for
  1201. > > >    Think and for Metrowerks?
  1202. > > 
  1203. > > You make the universal headers work under Think. Good luck!
  1204. > That, or use a few conditional compiles. I have 3 different programs which
  1205. > all compile under Think C, Metrowerks C (68k & PPC), and MPW PPC C and the
  1206. > total number of #ifdefs to support this amounts to about 3 for each entire
  1207. > program. Most of the hassles are with Universal ProcPtrs.
  1208.  
  1209. Making the Universal Headers work under THINK is not so hard.  Just turn on
  1210. 4-bit ints, 8-byte doubles, and put a "#define applec 1" in the THINK C
  1211. options pre-compile area.  With the possible exception of numerics, that
  1212. makes 99% of it work.
  1213.  
  1214. -- 
  1215. Aaron Giles
  1216. Macintosh & Newton Developer
  1217. Cornell University Medical College
  1218. giles@med.cornell.edu
  1219.  
  1220. +++++++++++++++++++++++++++
  1221.  
  1222. >From cshotton@oac.hsc.uth.tmc.edu (Chuck Shotton)
  1223. Date: Thu, 24 Feb 1994 11:32:10 -0600
  1224. Organization: Academic Computing, UT-Houston
  1225.  
  1226. In article <2kf2bt$e2b@news.kth.se>, d88-jwa@mumrik.nada.kth.se (Jon Wtte)
  1227. wrote:
  1228.  
  1229. > >3. If so (#2), how do I maintain the same set of source for
  1230. > >    Think and for Metrowerks?
  1231. > You make the universal headers work under Think. Good luck!
  1232.  
  1233. That, or use a few conditional compiles. I have 3 different programs which
  1234. all compile under Think C, Metrowerks C (68k & PPC), and MPW PPC C and the
  1235. total number of #ifdefs to support this amounts to about 3 for each entire
  1236. program. Most of the hassles are with Universal ProcPtrs.
  1237.  
  1238. --_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_\_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
  1239. Chuck Shotton                             \ 
  1240. Assistant Director, Academic Computing     \   "Are we there yet?"
  1241. U. of Texas Health Science Center Houston   \ 
  1242. cshotton@oac.hsc.uth.tmc.edu  (713) 794-5650 \ 
  1243. _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-\-_-_-_-_-_-_-_-_-_-_-_-_-
  1244.  
  1245. +++++++++++++++++++++++++++
  1246.  
  1247. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1248. Date: 25 Feb 94 11:12:16 +1300
  1249. Organization: University of Waikato, Hamilton, New Zealand
  1250.  
  1251. In article <2kd8u4$tv@romulus.ucs.uoknor.edu>, Willie Rauchwerger <willie-rauchwerger@uokhsc.edu> writes:
  1252. > Well, I was in the process of porting my program from
  1253. > Think C 6.0 to Metrowerks C++ 68k, and I ran into a little
  1254. > inconsistency with the Universal Header files and the old
  1255. > Think includes, and when I checked, the old MPW includes.
  1256. >
  1257. > (Note how the the first argument is defined.)
  1258. >
  1259. > In the Think headers, "ToolUtils.h":
  1260. > pascal void GetIndPattern(Pattern thePat,
  1261. >                           short patternListID, short index);
  1262. >
  1263. > In the old MPW headers, "ToolUtils.h":
  1264. > pascal void GetIndPattern(Pattern thePat,
  1265. >                           short patternListID, short index);
  1266. >
  1267. > But in the Metrowerks headers (Apple Universal Headers), "ToolUtil.h":
  1268. > extern pascal void GetIndPattern(Pattern *thePat,
  1269. >                           short patternListID, short index);
  1270. >
  1271. > And the Mac on RISC SDK headers (Apple Universal Headers) "ToolUtil.h":
  1272. > extern pascal void GetIndPattern(Pattern *thePat,
  1273. >                           short patternListID, short index);
  1274. >
  1275. > 1. Is this inconsistency a plain mistake?
  1276.  
  1277. It looks like a mistake in the first two versions that was corrected in the
  1278. last two. In Pascal calling conventions, anything larger than four bytes is
  1279. passed by reference, so I guess the incorrect version would actually work
  1280. (I've seen the same mistake elsewhere in the interfaces).
  1281.  
  1282. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  1283. Info & Tech Services Division              fax: +64-7-838-4066
  1284. University of Waikato            electric mail: ldo@waikato.ac.nz
  1285. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
  1286.  
  1287. ---------------------------
  1288.  
  1289. >From griscom@media.mit.edu (Dan Griscom)
  1290. Subject: Using handles to purged-unloaded resources
  1291. Date: Wed, 23 Feb 1994 03:46:25 GMT
  1292. Organization: MIT Media Laboratory
  1293.  
  1294.  
  1295. I want to delete a humongous resource from a resource file, but I
  1296. don't want to load it into memory first. I'd like to be able to do
  1297. this:
  1298.  
  1299. ...
  1300. SetResLoad(false);
  1301. theRes = Get1NamedResource(theResType, theResName);
  1302. SetResLoad(true);
  1303. RemoveResource(theRes);
  1304. ...
  1305.  
  1306. Would this be kosher? Is there a better way?
  1307.  
  1308. This can be restated as a more general question: can handles to
  1309. resources fetched when ResLoad is false (or handles to purged
  1310. resources) be used in routines where the resource contents aren't
  1311. needed, such as GetResSize, GetResInfo, SetResInfo, etc?
  1312.  
  1313. Thanks,
  1314. Dan Griscom
  1315. Suitable Systems
  1316.  
  1317. +++++++++++++++++++++++++++
  1318.  
  1319. >From ivanski@world.std.com (Ivan M CaveroBelaunde)
  1320. Date: Wed, 23 Feb 1994 14:27:21 GMT
  1321. Organization: The World Public Access UNIX, Brookline, MA
  1322.  
  1323. griscom@media.mit.edu (Dan Griscom) writes:
  1324. >I want to delete a humongous resource from a resource file, but I
  1325. >don't want to load it into memory first. I'd like to be able to do
  1326. >this:
  1327. >...
  1328. >SetResLoad(false);
  1329. >theRes = Get1NamedResource(theResType, theResName);
  1330. >SetResLoad(true);
  1331. >RemoveResource(theRes);
  1332. >...
  1333. >Would this be kosher? Is there a better way?
  1334.  
  1335. This works for me. Just to be sure, however, I'd double check that
  1336. the resID is what you expect - since resNames do not have to be
  1337. unique, it is possible you end up getting a different resource
  1338. from the one you wanted...
  1339.  
  1340. >This can be restated as a more general question: can handles to
  1341. >resources fetched when ResLoad is false (or handles to purged
  1342. >resources) be used in routines where the resource contents aren't
  1343. >needed, such as GetResSize, GetResInfo, SetResInfo, etc?
  1344.  
  1345. I cannot attest to every permutation of this, but the ones I've used
  1346. (Get/SetResInfo) worked fine.
  1347.  
  1348. -Ivan
  1349. ---
  1350. Ivan Cavero Belaunde (ivanski@world.std.com)
  1351. Avid VideoShop Project Lead
  1352. Avid Technology, Inc.
  1353.  
  1354. +++++++++++++++++++++++++++
  1355.  
  1356. >From peter@ncrpda.curtin.edu.au (Peter N Lewis)
  1357. Date: 24 Feb 1994 10:53:44 +0800
  1358. Organization: NCRPDA, Curtin University
  1359.  
  1360. ivanski@world.std.com (Ivan M CaveroBelaunde) writes:
  1361.  
  1362. >This works for me. Just to be sure, however, I'd double check that
  1363. >the resID is what you expect - since resNames do not have to be
  1364. >unique, it is possible you end up getting a different resource
  1365. >from the one you wanted...
  1366.  
  1367. WHy?  Resource IDs are not unique either, and you don't check them against
  1368. the name.  Basically, use the appropriate accessor depending on what you
  1369. resource you want.
  1370.    Peter.
  1371. -- 
  1372. _______________________________________________________________________
  1373. Peter N Lewis <peter.lewis@info.curtin.edu.au>       Ph: +61 9 368 2055
  1374.  
  1375. ---------------------------
  1376.  
  1377. >From greenber@reed.edu (Andrew Greenberg)
  1378. Subject: Using the serial ports as an input for a SPDT switch.
  1379. Date: 21 Feb 1994 23:14:03 GMT
  1380. Organization: Reed College,  Portland, Oregon
  1381.  
  1382. Hello!
  1383.  
  1384. I am attempting to read a simple SPDT microswitch via the serial ports
  1385. on Mac SEs and later models.
  1386.  
  1387. I'm using CTS (HSKo) as an input, and I need a differential signal (both
  1388. + and - ) to drive the input. The only way I can see to do this is hold
  1389. TxD low or high and use the two corresponding differential outputs (TxD+
  1390. and TxD-) as the differential signal I need.
  1391.  
  1392. I can't find any helpful references as to how to do this; the closest
  1393. I've seen is page 360 of the Mac Hardware reference (2nd ed) where it
  1394. talks about asserting /RTS. However, I can't find any info on how to do this.
  1395.  
  1396. If you have any information on asserting TxD or /RTS, I'd really appreciate
  1397. a quick note, or even a referral!
  1398. (I'm using Think c 6, BTW).
  1399.  
  1400. Thanks!!
  1401.  
  1402. Andrew Greenberg
  1403. (greenber@reed.edu)
  1404.  
  1405.  
  1406. +++++++++++++++++++++++++++
  1407.  
  1408. >From J <a@b.c.d>
  1409. Date: Tue, 22 Feb 1994 15:49:50 GMT
  1410. Organization: J
  1411.  
  1412. In article <2kbf7r$52o@scratchy.reed.edu> Andrew Greenberg,
  1413. greenber@reed.edu writes:
  1414.  
  1415. >I am attempting to read a simple SPDT microswitch via the serial ports
  1416. >on Mac SEs and later models...
  1417.  
  1418. We did something like this a while ago, using the serial port on a IIfx to
  1419. connect to a photocopy card reader/decrementer; a very simple machine, 
  1420. with one input (there is a card with value on it) and one output
  1421. (decrement
  1422. the card value by one unit).  (This is on a kiosk system in a gallery;
  1423. used to
  1424. charge for printouts.)
  1425.  
  1426. According to my notes (which aren't guaranteed to be accurate) we used a
  1427. three wire cable to connect the unit to the Mac, which was connected to
  1428. CTS (pin 2?), TxD (3) and GND (4).   The card reader shorted CTS to GND
  1429. when the it had a valid card; TxD was either asserted to decrement the
  1430. card.  I don't have any information about how CTS was tied high when
  1431. not being grounded.
  1432.  
  1433. To read the switch, we use:
  1434.    
  1435.   #define CAN_PRINT    -1
  1436.         if ( iErr = SerStatus( iPortRef, &PortStatus ) )
  1437.             ... error stuff
  1438.         return( PortStatus.ctsHold == CAN_PRINT );
  1439.  
  1440. To decrement the card value, we use
  1441.             if ( iErr = SerSetBrk( iPortRef ) )        ... error stuff
  1442.             Delay( 10L, &l );
  1443.             if ( iErr = SerClrBrk( iPortRef ) )        ... error stuff
  1444.  
  1445. My guess from reading your note is that if you wire your switch to flip
  1446. CTS between GND and TxD (presumably with a resistor), and combine the
  1447. two calls above to set break, read the switch, and then clear break, you
  1448. might have a working solution.
  1449.  
  1450. Caveat: I know nothing about hardware, and have destroyed logic boards in
  1451. my time; seek qualified medical advice, and I'm not responsible for any
  1452. damage you do....
  1453.  
  1454. Having said that, the above solution allowed us to make this interface
  1455. with
  1456. no additional hardware and has been working fine under heavy use on nine
  1457. workstations for the last 30 months.
  1458.  
  1459. Hope this helps,
  1460. Ben
  1461.  
  1462. +++++++++++++++++++++++++++
  1463.  
  1464. >From sokoloff@mv.mv.com (Jim Sokoloff)
  1465. Date: Fri, 25 Feb 1994 14:33:53 GMT
  1466. Organization: MV Communications, Inc.
  1467.  
  1468. I would recommend using the GPIa pin.  Docs for its use are in a Tech note
  1469. (something like 283 springs to mind)  Sorry, I worked on this long ago, 
  1470. before the tech notes got renamed.
  1471.  
  1472. If you can't find it, E-mail me and I'll look up the tech note for you.
  1473. If you don't have TNs, e-mail and I'll copy the source from the note and
  1474. forward it.
  1475.  
  1476. ---Jim Sokoloff
  1477.  
  1478.  
  1479. ---------------------------
  1480.  
  1481. >From warwick_j@cubldr.colorado.edu
  1482. Subject: WDEF Problems, driving me crazy...
  1483. Date: Wed, 23 Feb 1994 09:08:31 GMT
  1484. Organization: University of Colorado, Boulder
  1485.  
  1486. I have been writing a WDEF for a floating palette and have been running
  1487. into very strange erratic behaviour. Inside Macintosh : Toolbox Essentials
  1488. doesn't help any with its rather brief and incomplete description of how
  1489. to write a WDEF. What I need to know is:
  1490.  
  1491. 1) How to calculate the strucRgn and contRgn regions. IM:TE says to do
  1492.    this 'based on the current graphics port' but somehow I think that's
  1493.    wrong.
  1494.  
  1495. 2) How to retrieve standard window colors from the default color table
  1496.    easily. I want my palette to reflect the settings in the Color control
  1497.    panel.
  1498.  
  1499. 3) Which QD commands can be used when drawing a window's contents? I have
  1500.    had little success with RGBForeColor() - I usually get totally different
  1501.    colors to what I requested.
  1502.  
  1503. Any ideas? I would really appreciate any ideas or sample code you might
  1504. have.
  1505.  
  1506. Nick.
  1507.  
  1508. +++++++++++++++++++++++++++
  1509.  
  1510. >From t-gaul@i-link.com (Troy Gaul)
  1511. Date: Wed, 23 Feb 1994 11:47:39 -0600
  1512. Organization: I-Link, Ltd.
  1513.  
  1514. In article <1994Feb23.020831.1@cubldr.colorado.edu>,
  1515. warwick_j@cubldr.colorado.edu wrote:
  1516.  
  1517. > I have been writing a WDEF for a floating palette and have been running
  1518. > into very strange erratic behaviour. Inside Macintosh : Toolbox Essentials
  1519. > doesn't help any with its rather brief and incomplete description of how
  1520. > to write a WDEF. What I need to know is:
  1521.  
  1522. Well, first off, I'm wondering why you chose to write such a WDEF. I have
  1523. made and released a WDEF called the Infinity Windoid WDEF that implements
  1524. such a window look (if you're looking for a System 7-style floating
  1525. window). You can use it for free, and the source is included if you want to
  1526. modify any of its behavior.
  1527.  
  1528. > 1) How to calculate the strucRgn and contRgn regions. IM:TE says to do
  1529. >    this 'based on the current graphics port' but somehow I think that's
  1530. >    wrong.
  1531.  
  1532. I do the following:
  1533.  
  1534. void
  1535. GetGlobalMappingPoint(WindowPeek window, Point *thePoint) {
  1536.     //    This routine returns a point that gives the horizontal and vertical
  1537.     //  offsets needed to map something into global coordinates.
  1538.     GrafPtr savePort;
  1539.     
  1540.     GetPort(&savePort);
  1541.     SetPort((GrafPtr) window);
  1542.     
  1543.     SetPt(thePoint, 0, 0);
  1544.     LocalToGlobal(thePoint);
  1545.     
  1546.     SetPort(savePort);
  1547. }
  1548.  
  1549. void 
  1550. GetGlobalContentRect(WindowPeek window, Rect *contentRect) {
  1551.     Point mappingPoint;
  1552.  
  1553.     *contentRect = window->port.portRect;
  1554.     GetGlobalMappingPoint(window, &mappingPoint);
  1555.     OffsetRect(contentRect, mappingPoint.h, mappingPoint.v);
  1556. }
  1557.  
  1558. void 
  1559. DoWCalcRgns(WindowPeek window, long param) {
  1560.     #pragma unused(param)
  1561.     Rect theRect;
  1562.     RgnHandle tempRgn = NewRgn();
  1563.  
  1564.     // -- calculate the content Rect in global coordinates
  1565.     GetGlobalContentRect(window, &theRect);
  1566.     RectRgn(window->contRgn, &theRect);
  1567.  
  1568.     // -- start off with the structure equal to the content
  1569.     //    & make it include the window frame and titlebar
  1570.     InsetRect(&theRect, -1, -1);
  1571.     if (WindData.hasTitlebar) {
  1572.         if (WindData.isHoriz)
  1573.             theRect.top -= kTitleHeight - 1;
  1574.         else
  1575.             theRect.left -= kTitleHeight - 1;
  1576.     }
  1577.     RectRgn(window->strucRgn, &theRect);
  1578.     
  1579.     // -- add the shadow to the structure 
  1580.     OffsetRect(&theRect, 1, 1);
  1581.     RectRgn(tempRgn, &theRect);
  1582.     UnionRgn(tempRgn, window->strucRgn, window->strucRgn);
  1583.     
  1584.     DisposeRgn(tempRgn);
  1585. }
  1586.  
  1587.  
  1588. > 2) How to retrieve standard window colors from the default color table
  1589. >    easily. I want my palette to reflect the settings in the Color control
  1590. >    panel.
  1591.  
  1592. This is a little more involved. My code has a set of routines that let you
  1593. do this in the most compatible way. There are a lot of little things that
  1594. need to be handled. For example, if the device the floater is on is 8-bit
  1595. but isn't using the System Palette, there might not be enough different
  1596. colors available to appropriately do the color tinging. You will see the
  1597. System WDEF punts and uses black-and-white in that case. My routines handle
  1598. this in a way that is fully compatible with the System WDEF (i.e. when it
  1599. reverts to BW, so does mine).
  1600.  
  1601. > 3) Which QD commands can be used when drawing a window's contents? I have
  1602. >    had little success with RGBForeColor() - I usually get totally different
  1603. >    colors to what I requested.
  1604.  
  1605. If you want to draw in color, you have to make sure that you're using the
  1606. Color Window Manager port. By default, when the WDEF is called, the B/W
  1607. Window Manager port is the current port. Of course, you must sync the color
  1608. port up with the B/W one, which can be done using code like the following
  1609. (which was originally from Macintosh Programming Secrets and modified a
  1610. little by me for my WDEF):
  1611.  
  1612. void 
  1613. SyncPorts(void) {
  1614.     GrafPtr bwPort;
  1615.     CGrafPtr colorPort;
  1616.     
  1617.     GetWMgrPort(&bwPort);
  1618.     GetCWMgrPort(&colorPort);
  1619.     SetPort((GrafPtr) colorPort);
  1620.     
  1621.     BlockMove(&bwPort->pnLoc, &colorPort->pnLoc, 10);
  1622.     BlockMove(&bwPort->pnVis, &colorPort->pnVis, 14);
  1623.     PenPat((ConstPatternParam) &bwPort->pnPat);
  1624.     BackPat((ConstPatternParam) &bwPort->bkPat);
  1625. }
  1626.  
  1627. You should, of course, save the port in your main routine before calling
  1628. this, only call it if Color QuickDraw is present (actually, you only need
  1629. to call it for drawing calls), and restore the port before returning to the
  1630. Window Manager.
  1631.  
  1632. > Any ideas? I would really appreciate any ideas or sample code you might
  1633. > have.
  1634.  
  1635. Like I said before, you really don't have to do all this yourself. I have
  1636. already written a WDEF that does it for you. If you want a different look,
  1637. you can simply modify my WDEF.
  1638.  
  1639. The reason I released it to the public was to provide something I thought
  1640. was lacking in a lot of programs (and still is, when I look through a Mac
  1641. magazine and see a lot of them still using the bland B/W WDEF for floating
  1642. windows).
  1643.  
  1644. There are a lot of people using the Infinity Windoid WDEF now, so it has
  1645. been well tested (it's on its third public release). It supports System 6,
  1646. computers without Color QuickDraw, several different compilation options,
  1647. and it's free. What more could you ask for? (Seriously, if it doesn't do
  1648. something you think it should, let me know.)
  1649.  
  1650. You can always get the latest version of the Infinity Windoid WDEF via
  1651. anonymous FTP at the site 'ftp.i-link.com' in the directory '/pub/infsys/'.
  1652.  
  1653. _troy
  1654. //////// //////___Troy Gaul_________________________t-gaul@i-link.com__ //
  1655.   //    //       I-Link, Ltd. ; West Des Moines, Iowa                  //
  1656.  //    //  //   "Iungo ergo sum." (I-Link, therefore I am.)           //
  1657. //    //////________________________________________________________ //
  1658.  
  1659. +++++++++++++++++++++++++++
  1660.  
  1661. >From kenlong@netcom.com (Ken Long)
  1662. Date: Wed, 23 Feb 1994 18:48:37 GMT
  1663. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1664.  
  1665. I don't know how much research you've put into your floating palette 
  1666. peliminary background before starting it.  you may already have looked at 
  1667. the Infinity Windoid WDEF, and others.  But there's some source code on 
  1668. Apple's ftp for a program called "DTS.Draw" which has a color, picture 
  1669. menu which tears off.  Once torn off, it becomes a floating palette.
  1670.  
  1671. The pictures in the menu/palette are derived from 'cicn' resources.  They 
  1672. use the 'PICT' button proc of switching to the next higher 'PICT' 
  1673. resource ID number when clicked on.
  1674.  
  1675. You can tap a floater WDEF as the port where you implement your CDEF for 
  1676. your picture buttons.  As such, a ready-made WDEF may be all that's needed.
  1677.  
  1678. I've made floating palettes, just to see how.  All I did was use an 
  1679. existing WDEF for a floater (Infinity, if the titleBar will show), then 
  1680. used a CDEF for picture buttons.  I duplicated the appearence and button 
  1681. opperation (did not tie routines to them) of the MS Word button bar, and 
  1682. part of the Color It tool palette (for training purposes).
  1683.  
  1684. In ResEdit, where you select the procID for the window, I used one of the 
  1685. "?" ones (user defined) and just hooked up the Infinity WDEF to it (even 
  1686. though the title bar was under the menu bar).  Then, the hard part (not 
  1687. really hard, but monotonous) was to set up all the buttons and their 
  1688. 'CTRL' resources.  That "two by two" ID sequencing is quite patience 
  1689. taxing!  As well as doing all the 'CTRL's twice.
  1690.  
  1691. Imagine how it would be for a 256 color palette!  Of course, I did not 
  1692. get into a lot of refinement and detail.  Maybe there's a more brief 
  1693. method for such a thing?
  1694.  
  1695. All I'm saying is that if there's no difference, really, in the window, 
  1696. itself, from other WDEFs, then it's the content that would be the main 
  1697. part of the problem.  And in the case of a palette, it's a CDEF you're 
  1698. looking at.  And iff it's buttons, then the CDEF is pretty common, too - 
  1699. it's expanding it to cover all you want it to that's the job.
  1700.  
  1701. I made a double button bar for the author of KwikKnowledge (for 
  1702. MicroPhone II) which had two rows of 64x64 'PICT' buttons.  They appeared 
  1703. in a standard window.  I just used a 'PICT' button CDEF I downloaded from 
  1704. AOL, which had 3 buttons.  I just dumped the second two, which were 
  1705. different, copied the code for the first one, and hit Command-V 13 
  1706. times.  Then I went back and specified some parts of it.  This was in the 
  1707. CDEF resource code, itself.  once that was done, in was a matter of 
  1708. creating and aligning all the 'CTRL' resources, and adding the 'PICT' 
  1709. resources.  28 of them very monotonous.
  1710.  
  1711. A quicker way to do monotonous resource editing is to make one, decompile 
  1712. that one with ResTools, then make the remaining ones in the text editor.  
  1713. Works for the "easy to see" resources, like 'ditl's, 'CTRL's, etc.
  1714.  
  1715. Does any of this help, or did I miss (again)?
  1716.  
  1717. -Ken-
  1718.  
  1719. +++++++++++++++++++++++++++
  1720.  
  1721. >From kenlong@netcom.com (Ken Long)
  1722. Date: Thu, 24 Feb 1994 04:45:57 GMT
  1723. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1724.  
  1725. Troy's message was not there when I followed up.  His advice is more 
  1726. sound than mine because he's a professional programmer.  He made the 
  1727. Color It tool palette.  I assume the color palette, and others, as well.  
  1728. Awesomely done!  Very aesthetic.
  1729.  
  1730. I see that I wrote "CTRL" rather than "CNTL".  My cheap Apple Standard 
  1731. keyboard is the worse for wear.  Many keys have only a small black spot 
  1732. where the label was.  But you get the idea - the control resource.
  1733.  
  1734. What's the procID of the buttons in the Color It tool palette?  And on 
  1735. the color palette, how is the selection done there?
  1736.  
  1737. -Ken-
  1738.  
  1739. +++++++++++++++++++++++++++
  1740.  
  1741. >From dowdy@apple.com (Tom Dowdy)
  1742. Date: Wed, 23 Feb 1994 20:45:56 GMT
  1743. Organization: Apple Computer, Inc.
  1744.  
  1745. In article <kenlongCLoxL3.2M7@netcom.com>, kenlong@netcom.com (Ken Long)
  1746. wrote:
  1747. > A quicker way to do monotonous resource editing is to make one, decompile 
  1748. > that one with ResTools, then make the remaining ones in the text editor.  
  1749. > Works for the "easy to see" resources, like 'ditl's, 'CTRL's, etc.
  1750.  
  1751. Better yet, through creative use of calculations and #defines
  1752. you can actually structure layouts such as the one you are talking
  1753. about (2X2 CNTL arrays) using Rez.  
  1754.  
  1755. The real advantage to taking this approach is that when you decide
  1756. to change things like the size ("Oh gosh, wouldn't 3X3 be better?")
  1757. or the margins, a single change of a #define will get you the results.
  1758.  
  1759. GUI based layout apps are really nice for prototyping, but for
  1760. bulk work, you can often get faster results via the old-fashioned
  1761. text stream based way.
  1762.  
  1763. I usually layout the basics with ResEdit, and then DeRez and work
  1764. from there.  As an added bonus, you can structure your resources
  1765. to allow for building localized versions of your application
  1766. with just a script.
  1767.  
  1768. -- 
  1769.  Tom Dowdy                  Internet: dowdy@apple.COM
  1770.  Apple Computer MS:302-3KS  UUCP: {sun,voder,amdahl,decwrl}!apple!dowdy
  1771.  1 Infinite Loop            AppleLink: DOWDY1
  1772.  Cupertino, CA 95014       
  1773.  "The 'Ooh-Ah' Bird is so called because it lays square eggs."
  1774.  
  1775. +++++++++++++++++++++++++++
  1776.  
  1777. >From t-gaul@i-link.com (Troy Gaul)
  1778. Date: Thu, 24 Feb 1994 11:36:25 -0600
  1779. Organization: I-Link, Ltd.
  1780.  
  1781. In article <kenlongCLpp8M.BG2@netcom.com>, kenlong@netcom.com (Ken Long)
  1782. wrote:
  1783.  
  1784. > What's the procID of the buttons in the Color It tool palette?  
  1785.  
  1786. You're going to hate the answer. :)
  1787.  
  1788. We don't use resources for the buttons in the tool grid at all. We could,
  1789. we just didn't. They're coded directly into the program. The program knows
  1790. the boundry of the tool area in the tool palette, and it knows the size of
  1791. a button, so from there it generates the grid of buttons, then, in a simple
  1792. 'for' loop, it draws each of the buttons that need to be updated.
  1793.  
  1794. This let us change defines in the program to change the size of the
  1795. buttons. Actually, if I had done it all myself, I don't know if this is the
  1796. scheme I wouls have used. When I came into the project, there was already a
  1797. black and white cool palette. I simply changed the drawing routines to
  1798. handle the nice gray-shaded 3-D effect.
  1799.  
  1800. One other reason that we do things programmatically is that the tool
  1801. palette in Color It! can be edited by dragging and dropping tools into
  1802. spots in the palette (still, I think, one of the coolest features of the
  1803. Color It! tool palette, along with the popups for changing tool parameters
  1804. -- which, by the way, use a stub MDEF to call back into the program). It
  1805. would be possible to do an editable tool palette using controls, just more
  1806. work.
  1807.  
  1808. > And on the color palette, how is the selection done there?
  1809.  
  1810. As for the color palette, all I can say is that you haven't seen anything
  1811. yet! ;-)  The color palette in the next version is my design (the one in
  1812. the current version is an older design by Tom Pinkerton/Kim Montz), and I
  1813. (humbly) think that it's much cooler than the current one.  For the record,
  1814. the new one is generated by a drawing routine, into an offscreen GWorld.
  1815. Then it's just drawn onto the screen when needed with CopyBits.  The old
  1816. one is very similar.
  1817.  
  1818. As far as hit testing and current-color hilighting are concerned, these are
  1819. also done programmaticly. You see, the hit testing that needs to be done
  1820. depends on which type of Color Picker is up, and when a Color Wheel (or
  1821. Color Cube) is up, the color is determined by a distance/angle formula in
  1822. HSL (or HSB), and this color is then converted to RGB for use in the rest
  1823. of the program. When a grid of colors is up, the h and v coordinates of the
  1824. hit in the item are turned into a grid index by some simple mod math. The
  1825. indicators on the wheel/square require a bunch of extra work with regions
  1826. to achieve the effect of not flashing as they move.
  1827.  
  1828. _troy
  1829. //////// //////___Troy Gaul_________________________t-gaul@i-link.com__ //
  1830.   //    //       I-Link, Ltd. ; West Des Moines, Iowa                  //
  1831.  //    //  //   "Iungo ergo sum." (I-Link, therefore I am.)           //
  1832. //    //////________________________________________________________ //
  1833.  
  1834. ---------------------------
  1835.  
  1836. >From rba26@cas.org (Brad Andrews)
  1837. Subject: ZcbFree Goes Negative (Error Number 33)
  1838. Date: Mon, 21 Feb 1994 17:17:55 GMT
  1839. Organization: Chemical Abstracts Service
  1840.  
  1841. This has popped up in the application I am working on, and I am trying
  1842. to figure out why.  Does anyone know what kinds of things might
  1843. make this happen?  I have plenty of memory, so that is not the issue.
  1844.  
  1845. I am expanding the heap according to the logic Apple recommends if
  1846. that matters (at the start of the program).
  1847.  
  1848. ---
  1849.  
  1850. Brad Andrews
  1851. rba26@cas.org
  1852. All opinions are strictly mine
  1853.  
  1854.  
  1855. +++++++++++++++++++++++++++
  1856.  
  1857. >From Steve Bryan <sbryan@maroon.tc.umn.edu>
  1858. Date: Wed, 23 Feb 1994 05:15:34 GMT
  1859. Organization: Sexton Software
  1860.  
  1861. In article <1994Feb21.171755.14980@chemabs.uucp> Brad Andrews,
  1862. rba26@cas.org writes:
  1863. >This has popped up in the application I am working on, and I am trying
  1864. >to figure out why.  Does anyone know what kinds of things might
  1865. >make this happen?  I have plenty of memory, so that is not the issue.
  1866.  
  1867. Brad,
  1868.  
  1869. Amount of memory available is probably not an issue. When zcbFree becomes
  1870. negative that means that memory is being randomly (or not so randomly)
  1871. overwritten. Likely suspects might include not checking result codes and
  1872. proceeding with calls that depend on earlier calls having succeeded (eg
  1873. memory allocations). Another favorite is having your compiler doing a
  1874. multiplication with 2 byte integers when you thought it was using 4 byte
  1875. integers. The resulting negative number then plays havoc with the routine
  1876. that was not expecting it. One of my favorites was having a call to a low
  1877. level file system routine that expects ioNamePtr to be set to a sensible
  1878. value (like a Str255 variable set aside in the stack). If nothing was
  1879. done about (ioNamePtr) you will get unfriendly results even if the result
  1880. code looks good. One final suggestion would be if you call DisposHandle
  1881. on a handle that has already be disposed. There is an init called
  1882. something like Double Trouble which helps track down cases like that.
  1883. Steve Bryan                  InterNet: sbryan@maroon.tc.umn.edu
  1884. Sexton Software            CompuServe: 76545,527
  1885. Minneapolis, MN                   Fax: (612) 929-1799
  1886.  
  1887. +++++++++++++++++++++++++++
  1888.  
  1889. >From rollin@newton.apple.com (Keith Rollin)
  1890. Date: Tue, 22 Feb 1994 20:19:25 GMT
  1891. Organization: Apple Computer, Inc.
  1892.  
  1893. In article <1994Feb21.171755.14980@chemabs.uucp>, rba26@cas.org (Brad
  1894. Andrews) wrote:
  1895.  
  1896. > This has popped up in the application I am working on, and I am trying
  1897. > to figure out why.  Does anyone know what kinds of things might
  1898. > make this happen?  I have plenty of memory, so that is not the issue.
  1899. > I am expanding the heap according to the logic Apple recommends if
  1900. > that matters (at the start of the program).
  1901.  
  1902. Macintosh Technote ME #8 saith (in part):
  1903.  
  1904. "The Memory Manager will trigger an RID=33S system error when, during some
  1905. operation which scans the objects in the heap, it sees that its running
  1906. count of free bytes (zcbFree, an internal value) has become negative (an
  1907. impossible feat in normal operation). This is nearly always caused by
  1908. writing zeros past the end of one of the Memory ManagerUs heap blocks
  1909. (overwriting and corrupting the next blockUs header, making it appear to be
  1910. a free block).
  1911.  
  1912. "If you get this error, use a debugger (like Macsbug or TMON) when you
  1913. attempt to reproduce the error, to check the consistency of the heap up to
  1914. the point where the error occurs. You may need to do this repeatedly until
  1915. you isolate the operation that is corrupting the heap."
  1916.  
  1917. ----------------------------------------------------------------------------
  1918. Keith Rollin --- Phantom Programmer --- Apple Computer, Inc. --- Team
  1919. Newton
  1920.  
  1921. +++++++++++++++++++++++++++
  1922.  
  1923. >From mxmora@unix.sri.com (Matt Mora)
  1924. Date: 23 Feb 1994 09:00:41 -0800
  1925. Organization: SRI International, Menlo Park, CA
  1926.  
  1927. In article <rollin-220294121925@rollin-keith.apple.com> rollin@newton.apple.com (Keith Rollin) writes:
  1928.  
  1929. >----------------------------------------------------------------------------
  1930. >Keith Rollin --- Phantom Programmer --- Apple Computer, Inc. --- TeamNewton
  1931.                                          ^^^^^^^^^^^^^^^^^^^^
  1932. What's this? Time to sell the Taligent Stock? :-)
  1933.  
  1934.  
  1935. Xavier
  1936.  
  1937.  
  1938.  
  1939. -- 
  1940. ___________________________________________________________
  1941. Matthew Xavier Mora                    Matt_Mora@qm.sri.com
  1942. SRI International                       mxmora@unix.sri.com
  1943. 333 Ravenswood Ave                    Menlo Park, CA. 94025
  1944.  
  1945. +++++++++++++++++++++++++++
  1946.  
  1947. >From devon_hubbard@taligent.com (Devon Hubbard)
  1948. Date: Thu, 24 Feb 1994 20:29:05 GMT
  1949. Organization: Taligent, Inc.
  1950.  
  1951. In article <2kg23p$2ch@unix.sri.com>, mxmora@unix.sri.com (Matt Mora)
  1952. wrote:
  1953.  
  1954. > In article <rollin-220294121925@rollin-keith.apple.com> rollin@newton.apple.com (Keith Rollin) writes:
  1955. > >----------------------------------------------------------------------------
  1956. > >Keith Rollin --- Phantom Programmer --- Apple Computer, Inc. --- TeamNewton
  1957. >                                          ^^^^^^^^^^^^^^^^^^^^
  1958. > What's this? Time to sell the Taligent Stock? :-)
  1959. > Xavier
  1960.  
  1961. Why... do you have Taligent stock?  Gee, I'm jealous?
  1962.  
  1963. --------------------------------------------------------------------------
  1964. Devon Hubbard                                                Silicon Pilot
  1965. devon_hubbard@taligent.com                                   Taligent, Inc
  1966.  
  1967. ---------------------------
  1968.  
  1969. >From adelucia@eden.rutgers.edu (Apple-O)
  1970. Subject: any good magazines?
  1971. Date: 21 Feb 94 08:20:18 GMT
  1972. Organization: Rutgers Univ., New Brunswick, N.J.
  1973.  
  1974. Back in the day, Compute and Compute Gazette had some usefu stuff for learning about programming your computer, with listings of small programs, utiities and other good info. 
  1975.  
  1976. Are there any such pubications out for the mac? I've been out of programming for a while and would like to start learning using C and the mac.
  1977.  
  1978. -- 
  1979. Apollo
  1980.  
  1981. +++++++++++++++++++++++++++
  1982.  
  1983. >From watkeyeh@dunx1.ocs.drexel.edu (Edwin H. Watkeys III)
  1984. Date: Mon, 21 Feb 1994 15:52:44 GMT
  1985. Organization: Drexel University
  1986.  
  1987. In article <Feb.21.03.20.18.1994.6997@eden.rutgers.edu> adelucia@eden.rutgers.edu (Apple-O) writes:
  1988. >Back in the day, Compute and Compute Gazette had some usefu stuff
  1989. for learning about programming your computer, with listings of small
  1990. programs, utiities and other good info.
  1991.  
  1992. >Are there any such pubications out for the mac? I've been out of
  1993. programming for a while and would like to start learning using C and the mac.
  1994.  
  1995. Compute was a lot better at teaching you how to type than how to program.
  1996. Some of those things look like they came out of some Obfuscated BASIC
  1997. Programming Contest. In addition, Compute almost always sucked if you
  1998. cared about the Apple II or Macintosh. They had more VIC-20 programs than
  1999. Apple II ones! I hate them. They dedicated most of the damn issue to
  2000. Commodore crap, and they had another magazine (Compute Gazette) dedicated to
  2001. even more Commodore crap. I don't understand it. Talk about bad taste in
  2002. computers! I can hardly contain my indignation even today towards people who
  2003. put in the same league the Commodore 64 and the Apple IIe.
  2004.  
  2005. But to be constructive for a bit, MacTech Magazine (formerly MacTutor) is
  2006. the Mac developers' magazine. Not "the" as in "the best", but as in "the
  2007. only". There's stuff in there aimed at all sorts of experence levels.
  2008. Yeah, but how many hit points do you have? Ugh! Don't get me started on that! 
  2009.  
  2010. However, you might want to buy a few books instead. It's doubtful that it's
  2011. going to take you a month to digest whatever's in Dave Mark's column.
  2012. You'll be spending a lot of time waiting for the new MacTech to come out.
  2013. I find myself reading anything in English inside MacTech. Hmm, did you
  2014. know their person in charge of circulation is Al Estrada? You know, you go
  2015. crazy... Remember the part in The Treasure of the Sierra Madre where
  2016. Bogart starts laughing like a mad man as his head is engulfed in the
  2017. campfire's flames? Like that...
  2018.  
  2019. Macintosh C Programming Primer Volume I, SECOND EDITION, is pretty good.
  2020. Buy it. Macintosh Programming Secrets, SECOND EDITION, ranks right up
  2021. there with The Big Book of Hell in my list of all time favorite
  2022. technical/reference works. Buy it (Macintosh Programming Secrets, that is). 
  2023.  
  2024. And by the way, C is a good choice, because C is the only language you can
  2025. program the Mac in these days unless you're like Peter Lewis, who has
  2026. displayed uncommon courage in his battle to use a non-discipline-free
  2027. programming language, Pascal. I used to hate C and love Pascal. Now I
  2028. resigned to C and forget how all that pointer stuff works in Pascal. Isn't
  2029. life great?
  2030.  
  2031. I was just thinking -- WriteNow is really nice because it's written in
  2032. assembly, but with the Power Macintoshes coming out, they'd be in a better
  2033. position if their code was in C. "Better" is a mild way of putting it.
  2034. RightNow, they're screwed... (get it? hahahahaha!!!)
  2035.  
  2036. Get me the oxygen mask...ahh,
  2037. Ed
  2038. -- 
  2039. Ed Watkeys              watkeyeh@dunx1.ocs.drexel.edu  Drexel University
  2040. Philosopher-Programmer  EdWatkeys@distant.com           Distant Software
  2041.                         - Use finger for my PGP key. -
  2042.  
  2043. +++++++++++++++++++++++++++
  2044.  
  2045. >From jcg8@pyrite.SOM.CWRU.Edu (Jude Giampaolo)
  2046. Date: 21 Feb 1994 16:45:12 GMT
  2047. Organization: WSOM CSG, CWRU, Cleve., OH, 44106, USA
  2048.  
  2049. In article <CLL03w.8I4@Dunx1.OCS.Drexel.Edu> watkeyeh@dunx1.ocs.drexel.edu (Edwin H. Watkeys III) writes:
  2050. >In article <Feb.21.03.20.18.1994.6997@eden.rutgers.edu> adelucia@eden.rutgers.edu (Apple-O) writes:
  2051. >>Back in the day, Compute and Compute Gazette had some usefu stuff
  2052. >for learning about programming your computer, with listings of small
  2053. >programs, utiities and other good info.
  2054. >
  2055. >>Are there any such pubications out for the mac? I've been out of
  2056. >programming for a while and would like to start learning using C and the mac.
  2057. >
  2058. >Compute was a lot better at teaching you how to type than how to program.
  2059. >Some of those things look like they came out of some Obfuscated BASIC
  2060. >Programming Contest. In addition, Compute almost always sucked if you
  2061. >cared about the Apple II or Macintosh. They had more VIC-20 programs than
  2062. >Apple II ones! I hate them. They dedicated most of the damn issue to
  2063. >Commodore crap, and they had another magazine (Compute Gazette) dedicated to
  2064. >even more Commodore crap. I don't understand it. Talk about bad taste in
  2065. >computers! I can hardly contain my indignation even today towards people who
  2066. >put in the same league the Commodore 64 and the Apple IIe.
  2067.  
  2068. Commodores were the greatest machines! I still have mine, wonderful
  2069. little game box. The c64 was a much better (and cheaper) machine out
  2070. of the box than any of the Apple IIs ever were. IMHO of course... :)
  2071.  
  2072.  
  2073.  
  2074. --
  2075. Jude Charles Giampaolo           -  Case Western Reserve University
  2076. Electrical Engineering           -                  Cleveland, Ohio
  2077. and Applied Physics              -  giampaol@snowhite.eeap.cwru.edu
  2078. Project Caffeine Programmer      -                 jcg8@po.cwru.edu      
  2079.  
  2080. +++++++++++++++++++++++++++
  2081.  
  2082. >From peter@ncrpda.curtin.edu.au (Peter N Lewis)
  2083. Date: 22 Feb 1994 11:32:58 +0800
  2084. Organization: NCRPDA, Curtin University
  2085.  
  2086. adelucia@eden.rutgers.edu (Apple-O) writes:
  2087.  
  2088. >Back in the day, Compute and Compute Gazette had some usefu stuff for
  2089. >learning about programming your computer, with listings of small programs,
  2090. >utiities and other good info. 
  2091.  
  2092. Well, I dont know about a magazine, it doesn't have any adds or anything,
  2093. but Develop is a very good programmers mag.  Its fairly technical
  2094. (pleasant change) and informal (ditto), but it also comes with a CD
  2095. that has all the NIM stuff on it, so its very useful to get.  Plus its
  2096. pretty reasonably priced (US$50 for international, so it must be less for
  2097. US people).
  2098.  
  2099. Now if I ever get my first copy, I'll be even happier...
  2100.    Peter.
  2101. -- 
  2102. _______________________________________________________________________
  2103. Peter N Lewis <peter.lewis@info.curtin.edu.au>       Ph: +61 9 368 2055
  2104.  
  2105. +++++++++++++++++++++++++++
  2106.  
  2107. >From sro@athena.mit.edu (Shawn O'Donnell)
  2108. Date: 22 Feb 1994 19:26:03 GMT
  2109. Organization: Massachusetts Institute of Technology
  2110.  
  2111. I'd give a thumbs down to MacTech Magazine--its useful-things-you-might-
  2112. learn-to-price ratio is too high.  In a good month, you'll get a useful
  2113. Dave Mark column and maybe another article that's useful for someone
  2114. trying to use C on the Mac.  At $4.00 subscription price, $5.85
  2115. newsstand price, that's a lot per page of useful stuff.  
  2116.  
  2117. On the other hand, if someone else is paying, or if you need to see the
  2118. ads for all the development tools, then it might make sense.
  2119.  
  2120. Instead, buy any book about programming the Mac with Knaster as an
  2121. author.  Buy one by Dave Mark if you want a more introductory look at C
  2122. programming on the Mac.  Or that one by Sydow: Think THINK C.
  2123.  
  2124. --Shawn
  2125.  
  2126. +++++++++++++++++++++++++++
  2127.  
  2128. >From editorial@xplain.com (Scott T Boyd)
  2129. Date: Thu, 24 Feb 1994 10:15:04 GMT
  2130. Organization: MacTech Magazine
  2131.  
  2132. <sorry if this is a repost, my connection dropped while sending the first
  2133. time>
  2134.  
  2135. In article <SRO.94Feb22142603@carbonara.mit.edu>, sro@athena.mit.edu (Shawn
  2136. O'Donnell) wrote:
  2137. > I'd give a thumbs down to MacTech Magazine--its useful-things-you-might-
  2138. > learn-to-price ratio is too high.  In a good month, you'll get a useful
  2139. > Dave Mark column and maybe another article that's useful for someone
  2140. > trying to use C on the Mac.  At $4.00 subscription price, $5.85
  2141. > newsstand price, that's a lot per page of useful stuff.  
  2142.  
  2143. Well, funny you should mention that.  
  2144.  
  2145. <----Warning, blatant plug for the magazine is about to happen---->
  2146.  
  2147. Dave Mark's columns generate a lot of mail.  Some people wonder why we 
  2148. carry what they consider to be such rudimentary articles.  Lots more 
  2149. praise his work for easing them gently into Macintosh programming without
  2150. being overwhelmed with complexity.
  2151.  
  2152. What can you do? Improve it all, that's what.  We're working on that, 
  2153. and that's why they recently brought me on as Editor.  I'll be working to
  2154. improve the good-stuff-to-price ratio.  
  2155.  
  2156. To give you something of an idea, we're covering PowerPC technical issues,
  2157. including debugging tips and tricks, details of the PEF file structure,
  2158. calling 68K code from PowerPC code, as well as doing reviews of recent
  2159. developments in a wide variety of tools and development environments.
  2160.  
  2161. You can help.  Write me and let me know what you like, don't like,
  2162. and what you'd like to see us cover.  I get a lot of mail already, so I'm
  2163. not going to promise to reply to everything, but I'll make a good faith
  2164. effort to read everything, and reply when I can.  Don't be surprised if
  2165. a change or idea you suggest winds up in the magazine.
  2166.  
  2167. Even better, write an article for us.  A good, meaty, technical article in
  2168. the useful-things-you-might-learn category.  Send me a note with an outline
  2169. of something you'd like to write about, and we can take it from there. Tips
  2170. and tricks of the trade are also quite welcome.
  2171.  
  2172. > On the other hand, if someone else is paying, or if you need to see the
  2173. > ads for all the development tools, then it might make sense.
  2174.  
  2175. Yes, there is a lot of good information in the ads, and we're working to
  2176. bring you even more interesting things.  
  2177.  
  2178. Please feel free to let us know how we're doing.  You, the reader, are
  2179. the audience we're hoping to please.
  2180.  
  2181. Regards,
  2182. scott t boyd
  2183. (the new) Editor, MacTech Magazine
  2184. editorial@xplain.com
  2185.  
  2186. ---------------------------
  2187.  
  2188. End of C.S.M.P. Digest
  2189. **********************
  2190.  
  2191.