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

  1. Received-Date: Fri, 22 Apr 1994 12:17:43 +0200
  2. From: pottier@clipper.ens.fr (Francois Pottier)
  3. Subject: csmp-digest-v3-018
  4. To: csmp-digest@ens.fr
  5. Date: Fri, 22 Apr 94 12:17:36 MET DST
  6. X-Mailer: ELM [version 2.3 PL11]
  7. Errors-To: listman@ens.fr
  8. Reply-To: pottier@clipper.ens.fr
  9. X-Sequence: 20
  10.  
  11. C.S.M.P. Digest             Fri, 22 Apr 94       Volume 3 : Issue 18
  12.  
  13. Today's Topics:
  14.  
  15.         CD-ROM of Mac source code?
  16.         Color Quickdraw Intimcay
  17.         Custom popup menu
  18.         Editable pop-up menus
  19.         Females who answer questions?
  20.         HELP - PICT File ColorTables and Palettes
  21.         Max # of open files
  22.         Proper QT PICT creation?
  23.         Q: Changing font & size of dialog items
  24.         Removing PowerPC code from a fat binary
  25.         Roman Numerals
  26.         SCSI Drivers
  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 celestin@pt.olympus.net (Paul Celestin)
  71. Subject: CD-ROM of Mac source code?
  72. Date: 5 Apr 1994 21:39:46 GMT
  73. Organization: Celestin Company
  74.  
  75. Does anyone know of a CD-ROM of Mac source code? I know there are plenty of
  76. sites on the Internet with source code, but has anyone compiled it all into
  77. one CD-ROM? If not, are there any people interested in something like this?
  78. If it's not available, I might do it myself.
  79.  
  80. Thanks for all replies.
  81. -- 
  82. celestin@pt.olympus.net              (Paul Celestin, Celestin Company)
  83. Check out my URL:   file://speedway.net/pub/celestin/www/Celestin.html
  84.  
  85. +++++++++++++++++++++++++++
  86.  
  87. >From blob@apple.com (Brian Bechtel)
  88. Date: 7 Apr 1994 22:57:04 -0700
  89. Organization: Apple Computer, Inc., Cupertino, California
  90.  
  91. celestin@pt.olympus.net (Paul Celestin) writes:
  92.  
  93. >Does anyone know of a CD-ROM of Mac source code? I know there are plenty of
  94. >sites on the Internet with source code, but has anyone compiled it all into
  95. >one CD-ROM? If not, are there any people interested in something like this?
  96. >If it's not available, I might do it myself.
  97.  
  98. MacTech Journal sells a CD-ROM with all the source code and articles
  99. they've ever published.
  100.  
  101. Wayzata publishes Disc Tracy, which is a collection of Macintosh source
  102. code on CD-ROM.  Wayzata is in the metropolitan Minneapolis Minnesota
  103. area.
  104.  
  105. --Brian Bechtel     blob@apple.com     "My opinion, not Apple's"
  106.  
  107. +++++++++++++++++++++++++++
  108.  
  109. >From Rand_Arnold@blt.berkeley.ca.us (Rand Arnold)
  110. Date: Fri,  8 Apr 94 17:24:17 PST
  111. Organization: Berkeley Learning Technologies, Inc.
  112.  
  113. Paul Celestin writes:
  114.  
  115. >>Does anyone know of a CD-ROM of Mac source code? I know there are plenty of
  116. >>sites on the Internet with source code, but has anyone compiled it all into
  117. >>one CD-ROM? If not, are there any people interested in something like this?
  118. >>If it's not available, I might do it myself.
  119.  
  120.  
  121. Xplain Corporation sells a CD-ROM that contains all of the source code from the
  122. last eight years of MacTutor/MacTech magazine. It can be quite a resource.
  123. Xplain can be reached at custservice@xplain.com or info@xplain.com, voice (310)
  124. 575-4343.
  125.  
  126. Rand
  127. Berkeley Learning Technologies, Inc.                           (510) 540-5963
  128.  
  129. ---------------------------
  130.  
  131. >From veenkerb@seq.oit.osshe.edu (Brian Veenker)
  132. Subject: Color Quickdraw Intimcay
  133. Date: 1 Apr 1994 13:00:57 -0600
  134. Organization: UTexas Mail-to-News Gateway
  135.  
  136. Crud. So GWorlds don't work on non-Color Quickdraw machines. One user 
  137. suggested that I just leave my data in some native format and just draw 
  138. it as I go. I want this prog to run on everything, but that sounds like a 
  139. huge pain in the butt.. Especially since I probably won't be able to work 
  140. on it on my PB100 now...
  141.  
  142. WAIT a minute, I just copied the thing over (to my PB100), and it woiks! 
  143. Groovy! I'm back in business! Thanks everyone!
  144.  
  145. BTW: does it make any difference that I'm only using a 1-bit depth in my 
  146. GWorld? Could that have helped? Or is it that my PB100 just happens to be 
  147. running Color Quickdraw?
  148.  
  149. Thanks again everybody!
  150. Brian Veenker
  151.  
  152.  
  153.  
  154. +++++++++++++++++++++++++++
  155.  
  156. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  157. Date: 5 Apr 94 12:43:02 +1300
  158. Organization: University of Waikato, Hamilton, New Zealand
  159.  
  160. In article <Pine.3.88.9404011059.A20930-0100000@seq.oit.osshe.edu>, veenkerb@seq.oit.osshe.edu (Brian Veenker) writes:
  161. > Crud. So GWorlds don't work on non-Color Quickdraw machines. One user
  162. > suggested that I just leave my data in some native format and just draw
  163. > it as I go. I want this prog to run on everything, but that sounds like a
  164. > huge pain in the butt.. Especially since I probably won't be able to work
  165. > on it on my PB100 now...
  166. >
  167. > WAIT a minute, I just copied the thing over (to my PB100), and it woiks!
  168. > Groovy! I'm back in business! Thanks everyone!
  169. >
  170. > BTW: does it make any difference that I'm only using a 1-bit depth in my
  171. > GWorld? Could that have helped? Or is it that my PB100 just happens to be
  172. > running Color Quickdraw?
  173.  
  174. Your PB100 does not have Color QuickDraw. However, under System 7, even
  175. non-Color-QuickDraw machines have GWorlds, albeit limited to 1 bit per pixel,
  176. as you were using.
  177.  
  178. IM6 has a list somewhere of the Color QuickDraw calls you're allowed to make
  179. on a non-Color-QuickDraw machine under System 7.
  180.  
  181. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  182. Info & Tech Services Division              fax: +64-7-838-4066
  183. University of Waikato            electric mail: ldo@waikato.ac.nz
  184. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  185.  
  186. +++++++++++++++++++++++++++
  187.  
  188. >From Ron_Hunsinger@bmug.org (Ron Hunsinger)
  189. Date: Sun,  3 Apr 94 19:56:38 PST
  190. Organization: Berkeley Macintosh Users Group
  191.  
  192. veenkerb@seq.oit.osshe.edu (Brian Veenker) writes:
  193.  
  194. >Crud. So GWorlds don't work on non-Color Quickdraw machines. One user 
  195. >suggested that I just leave my data in some native format and just draw 
  196. >it as I go. I want this prog to run on everything, but that sounds like a 
  197. >huge pain in the butt.. Especially since I probably won't be able to work 
  198. >on it on my PB100 now...
  199. >
  200. >WAIT a minute, I just copied the thing over (to my PB100), and it woiks! 
  201. >Groovy! I'm back in business! Thanks everyone!
  202. >
  203. >BTW: does it make any difference that I'm only using a 1-bit depth in my 
  204. >GWorld? Could that have helped? Or is it that my PB100 just happens to be 
  205. >running Color Quickdraw?
  206.  
  207. Don't confuse "Color Quickdraw" with "monitor is displaying color".
  208. "Color Quickdraw" means that you have the version of Quickdraw that 
  209. understands what color is.  It doesn't necessarily mean that you have
  210. your monitor(s) set to display color, or even that you have a color-
  211. capable monitor.
  212.  
  213. Color Quickdraw is in the ROMS of Mac II and later machines, and is also
  214. in System 7 or later.  So you can probably depend on color QD and still
  215. run on almost everything.  You will be locking out only SE and earlier
  216. machines running on 6.0.8 and earlier, and I think even for those machines 
  217. there may be an INIT that will supply color QD.  For that matter, if you
  218. are using GWorlds, you are already depending on Sys7, so you should have
  219. color QD already.  Of course, the noble thing would be to check anyway...
  220.  
  221. -Ron Hunsinger
  222.  
  223. +++++++++++++++++++++++++++
  224.  
  225. >From Carl R. Osterwald <carl_osterwald@nrel.gov>
  226. Date: Wed, 6 Apr 94 16:08:32 GMT
  227. Organization: National Renewable Energy Laboratory
  228.  
  229. In article <001343F1.fc@bmug.org> Ron Hunsinger, Ron_Hunsinger@bmug.org
  230. writes:
  231. >Color Quickdraw is in the ROMS of Mac II and later machines, and is also
  232. >in System 7 or later.  So you can probably depend on color QD and still
  233. >run on almost everything.  You will be locking out only SE and earlier
  234. >machines running on 6.0.8 and earlier, and I think even for those
  235. machines 
  236. >there may be an INIT that will supply color QD.  For that matter, if you
  237. >are using GWorlds, you are already depending on Sys7, so you should have
  238. >color QD already.  Of course, the noble thing would be to check anyway...
  239.  
  240. This is not entirely true, Color QD will not run on 68000 Macs, not even
  241. with the prism INIT.  Many of the Color QD routines are written in 68020
  242. assembler.  One of the Tech Notes explains this.
  243.  
  244. +++++++++++++++++++++++++++
  245.  
  246. >From gdl@stlawrence.maths (Greg Landweber)
  247. Date: 08 Apr 1994 11:37:03 GMT
  248. Organization: (none)
  249.  
  250. In article <001343F1.fc@bmug.org> Ron_Hunsinger@bmug.org (Ron Hunsinger) writes:
  251.    Color Quickdraw is in the ROMS of Mac II and later machines, and is also
  252.    in System 7 or later.  So you can probably depend on color QD and still
  253.    run on almost everything.  You will be locking out only SE and earlier
  254.    machines running on 6.0.8 and earlier, and I think even for those machines 
  255.    there may be an INIT that will supply color QD.  For that matter, if you
  256.    are using GWorlds, you are already depending on Sys7, so you should have
  257.    color QD already.  Of course, the noble thing would be to check anyway...
  258.  
  259. This is NOT true.  Color Quickdraw is optimized for use with a 68020
  260. processor or better, and it will NOT run on any machine with a 68000.
  261. System 7 contains an updated version of 32-bit QuickDraw, but that is
  262. useless on machines like the Plus, SE, Classic, Portable, PB100.
  263.  
  264. -- Greg "Browser" Landweber
  265.  
  266. ---------------------------
  267.  
  268. >From ping@genie.demon.co.uk ("K.H.Ping")
  269. Subject: Custom popup menu
  270. Date: Fri, 8 Apr 1994 15:59:42 +0000
  271. Organization: Associated Newspapers
  272.  
  273. Hi,
  274.  
  275. can anyone tell me how to do a popup menu (with no popup box) that is 
  276. attached to a window bar (like the one that appears if you hold down the 
  277. option key and click in the title bar of a window under THINK C 6.0)? 
  278.  
  279. +++++++++++++++++++++++++++
  280.  
  281. >From petm@soda.berkeley.edu (Peter Mattis)
  282. Date: 8 Apr 1994 20:22:53 GMT
  283. Organization: Computer Science Undergrad Assoc., UCBerkeley
  284.  
  285. In article <765849410snx@genie.demon.co.uk>,
  286. K.H.Ping <ping@genie.demon.co.uk> wrote:
  287. >Hi,
  288. >
  289. >can anyone tell me how to do a popup menu (with no popup box) that is 
  290. >attached to a window bar (like the one that appears if you hold down the 
  291. >option key and click in the title bar of a window under THINK C 6.0)? 
  292.  
  293. Well, since the application (you) draws the popup box then if you
  294. don't want one then don't draw it.
  295.  
  296. To do a popup like the one in THINK C 6.0 all you have to do is
  297. call PopUpMenuSelect(myMenu, vPosition, hPostion, lastItem)
  298.  
  299. -myMenu is the MenuHandle to your menu
  300. -vPosition is the vertical position of the mouse click.
  301.  (you can adjust this value so that the popup doesn't appear
  302.   below and to the right of the cursor always like it does in 
  303.   THINK)
  304. -hPosition is the horizontal position of the mouse click.
  305.  (you can adjust this value just like vPosition)
  306. -lastItem is the number of the last item selected. But since
  307.  there is no "last item" because you don't have a popup box then
  308.  this value should be 1.
  309.  
  310. Oh, and you call PopUpMenuSelect whenever you determine there has
  311. been an option-click in the title bar of your window.
  312.  
  313. -Peter Mattis
  314.  
  315.  
  316. ---------------------------
  317.  
  318. >From molly@i-link.com (Molly Gilmore Baldwin)
  319. Subject: Editable pop-up menus
  320. Date: 6 Apr 1994 03:51:34 GMT
  321. Organization: I-Link, Ltd., Des Moines, Iowa, US - 515/255-2754
  322.  
  323. I'd like to set up a pop-up menu that people could also type a value in
  324. for.  The most common example of what I'm trying to do would be a point
  325. size pop-up, in which you get to pick the common point sizes in 6-point
  326. increments, but where you could also just type in 17.
  327.  
  328. Does anyone know of some good examples of how to do this? 
  329.  
  330. +++++++++++++++++++++++++++
  331.  
  332. >From pcastine@jake.prz.tu-berlin.de (Peter Castine)
  333. Date: Wed, 6 Apr 1994 19:24:31 GMT
  334. Organization: PRZ TU-Berlin
  335.  
  336. molly@i-link.com (Molly Gilmore Baldwin) writes:
  337. >I'd like to set up a pop-up menu that people could also type a value in
  338. >for.  The most common example of what I'm trying to do would be a point
  339. >size pop-up, in which you get to pick the common point sizes in 6-point
  340. >increments, but where you could also just type in 17.
  341. >
  342. >Does anyone know of some good examples of how to do this? 
  343.  
  344. There are detailed examples of what this should look like in _Inside
  345. Macintsoh VI_, see Figures 2-30 and 2-31 in the User Interface
  346. chapter. I'm sure the examples are in _NIM_, but I don't have it,
  347. so I can't tell you where to look.
  348.  
  349. Implementation is pretty straight-forward when you see the examples.
  350. hope this pointer gets you on the right track...
  351. -- 
  352. Peter Castine                      | One child is shot every two hours
  353. pcastine@jake.kgw.tu-berlin.de     | in the U.S.A.
  354.                    | Thank you for blocking gun control,
  355.                    | N.R.A.
  356.  
  357. +++++++++++++++++++++++++++
  358.  
  359. >From ari@world.std.com (Ari I Halberstadt)
  360. Date: Thu, 7 Apr 1994 00:21:43 GMT
  361. Organization: The World Public Access UNIX, Brookline, MA
  362.  
  363. In article <molly-050494225023@ts1-3.i-link.com>,
  364. Molly Gilmore Baldwin <molly@i-link.com> wrote:
  365. >I'd like to set up a pop-up menu that people could also type a value in
  366. >for.  The most common example of what I'm trying to do would be a point
  367. >size pop-up, in which you get to pick the common point sizes in 6-point
  368. >increments, but where you could also just type in 17.
  369. >
  370. >Does anyone know of some good examples of how to do this? 
  371.  
  372. You can use my Popup CDEF. I just sent the current version (1.0b3) to
  373. the info-mac archives and it should be available there in the
  374. /info-mac/dev/src directory within a few days. It was also posted a
  375. few weeks ago to alt.sources.mac and is available in the file
  376.  
  377. ftpbio.bgsu.edu:/ftp/pub/alt.sources.mac/popupcdef1.0b3.cpt.hqx
  378.  
  379. The file "PopupCDEF-demo.c" contains sample code that shows how a font
  380. size type-in popup menu can be managed.
  381. -- 
  382. Ari Halberstadt    ari@world.std.com     #include <std/disclaimer.h>
  383. "These beetles were long considered to be very rare because very few
  384. entomologists look for beetles in the mountains, in winter, at night,
  385. during snow storms." -- Purves W. K., et al, "Life: The Science of
  386.  
  387. ---------------------------
  388.  
  389. >From susanlesch@aol.com (SusanLesch)
  390. Subject: Females who answer questions?
  391. Date: 18 Mar 1994 04:52:04 -0500
  392. Organization: America Online, Inc. (1-800-827-6364)
  393.  
  394. Informal survey
  395.   In your own experience, how many females regularly answer
  396.   programming and technical questions in this newsgroup? I
  397.   mean women who often answer (rather than ask) questions
  398.   about programming (or, failing that, anything you would
  399.   term "technical").
  400.  
  401.   As determined informally in 1993 by a source I cannot
  402.   reveal, there were approximately two qualifiers in
  403.   Macintosh programming on the entire Internet. As
  404.   determined by myself, through logging CompuServe's
  405.   Macintosh Developers' Forums, I found about two also.
  406.   (Just a note that CIS' name fields allow full names,
  407.   unlike AOL and other online services who have only 10
  408.   available characters, which seems to lead to ambiguity in
  409.   gender by name.)
  410.  
  411.   I do not mean to suggest that these 1000:1? ratios
  412.   reflect all working programmers! I am curious to know if
  413.   my source re: the Internet was being facetious or rather,
  414.   as I tend to suspect, being fairly accurate.
  415.  
  416. Thanks very much for any replies,
  417. Susan Lesch
  418. (an Internet and C novice)
  419. P.S. Pardon the multiple postings, my mistake.
  420.  
  421. +++++++++++++++++++++++++++
  422.  
  423. >From wdh@netcom.com (Bill Hofmann)
  424. Date: Fri, 18 Mar 1994 18:36:49 GMT
  425. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  426.  
  427. susanlesch@aol.com (SusanLesch) writes:
  428. >Informal survey
  429. >  In your own experience, how many females regularly answer
  430. >  programming and technical questions in this newsgroup? I
  431. >  mean women who often answer (rather than ask) questions
  432. >  about programming (or, failing that, anything you would
  433. >  term "technical").
  434. Not many, but I think probably a larger percentage than are distributed
  435. amongst the developer community as a whole.  My experience with teaching
  436. gobs of Apple and non-Apple developers is that *at this point* many of
  437. the senior software types are still men, reflecting mostly a generational
  438. lag in women's participation in the field.  After all, my class at MIT
  439. had about 15-20% women, so it isn't suprising that people my age who
  440. post are mostly men.  Plus fewer women seem to like to flame :->
  441. -- 
  442. -Bill Hofmann                    wdh@netcom.COM
  443.  Fresh Software and Instructional Design    +1 510 524 0852
  444.  
  445. +++++++++++++++++++++++++++
  446.  
  447. >From schiffer@dispair.stsci.edu (Francis H. Schiffer 3rd)
  448. Date: Fri, 18 Mar 1994 20:12:51 GMT
  449. Organization: Self
  450.  
  451. In article <wdhCMvIDD.Dts@netcom.com>, wdh@netcom.com (Bill Hofmann) wrote:
  452.  
  453. > post are mostly men.  Plus fewer women seem to like to flame :->
  454.  
  455. That is my wife's analysis as to why there are so few women posting on many
  456. of the Usenet groups.  There are many more posts by women on email circles
  457. and/or Usenet groups where the flamage is minimal.
  458.          skip
  459. -- 
  460. Francis H Schiffer 3rd  schiffer@stsci.edu - my opinions only, those of
  461. skip@dispair.stsci.edu  stscic::schiffer   - my employer are unknown to me
  462.  
  463. +++++++++++++++++++++++++++
  464.  
  465. >From mikeh@kralizec.zeta.org.au (Michael Hore)
  466. Date: 26 Mar 1994 16:55:02 +1000
  467. Organization: Kralizec Dialup Unix Sydney: +61-2-837-1183 V.32bis
  468.  
  469.  
  470. susanlesch@aol.com (SusanLesch) writes:
  471.  
  472. >  In your own experience, how many females regularly answer
  473. >  programming and technical questions in this newsgroup? I
  474. >  mean women who often answer (rather than ask) questions
  475. >  about programming (or, failing that, anything you would
  476. >  term "technical").
  477. >
  478. >  As determined informally in 1993 by a source I cannot
  479. >  reveal, there were approximately two qualifiers in
  480. >  Macintosh programming on the entire Internet.
  481.  
  482. I've been reading c.s.m.p for a couple of years now, and I'd have to
  483. say that that's two more than I've ever noticed.
  484.  
  485. But I've been to a number of Mac developers' meetings here in
  486. Sydney, Australia, and the ratio there was more like 10:1.
  487.  
  488. My son is studying CS at university - I must check with him to see
  489. if the ratio is higher there, so that we could say that there's
  490. any sort of trend.
  491.  
  492. As another poster said, I suspect there's a reluctance to get involved
  493. in a Usenet group with all the flamage etc. that goes on.
  494.  
  495. [...snip...]
  496. >  I do not mean to suggest that these 1000:1? ratios
  497. >  reflect all working programmers! I am curious to know if
  498. >  my source re: the Internet was being facetious or rather,
  499. >  as I tend to suspect, being fairly accurate.
  500.  
  501. Looks accurate to me.
  502.  
  503. >Thanks very much for any replies,
  504. >Susan Lesch
  505. >(an Internet and C novice)
  506.  
  507. Welcome!
  508.  
  509. --  Mike.
  510.  
  511. - --------------------------------------------------------
  512. Mike Hore          mikeh@kralizec.zeta.org.au
  513. .sig deliberately kept short to minimize .sig/noise ratio.
  514. - --------------------------------------------------------
  515.  
  516. +++++++++++++++++++++++++++
  517.  
  518. >From lrucker@parcplace.com (Lee Ann Rucker)
  519. Date: 30 Mar 1994 22:16:00 GMT
  520. Organization: ParcPlace
  521.  
  522.  susanlesch@aol.com (SusanLesch) writes:
  523.  
  524.  >  In your own experience, how many females regularly answer
  525.  >  programming and technical questions in this newsgroup? I
  526.  >  mean women who often answer (rather than ask) questions
  527.  >  about programming (or, failing that, anything you would
  528.  >  term "technical").
  529.  >
  530.  
  531. I've answered a few questions.  I don't answer often, because questions
  532. generally fall into two categories: so simple that the answer's been posted
  533. before the question gets to my newsreader, or out of my area of expertise -
  534. I see very few questions about the internals of the Smalltalk Virtual
  535. Machine.
  536.  
  537. LeeAnn Rucker
  538. ParcPlace Systems
  539.  
  540. +++++++++++++++++++++++++++
  541.  
  542. >From sichase@csa5.lbl.gov (SCOTT I CHASE)
  543. Date: 31 Mar 1994 10:52 PST
  544. Organization: Lawrence Berkeley Laboratory - Berkeley, CA, USA
  545.  
  546. In article <lrucker-300394141641@leeann-mac.parcplace.com>, lrucker@parcplace.com (Lee Ann Rucker) writes...
  547. > susanlesch@aol.com (SusanLesch) writes:
  548. > >  In your own experience, how many females regularly answer
  549. > >  programming and technical questions in this newsgroup? I
  550. > >  mean women who often answer (rather than ask) questions
  551. > >  about programming (or, failing that, anything you would
  552. > >  term "technical").
  553. > >
  554. >I've answered a few questions.  I don't answer often, because questions
  555. >generally fall into two categories: so simple that the answer's been posted
  556. >before the question gets to my newsreader, or out of my area of expertise -
  557. >I see very few questions about the internals of the Smalltalk Virtual
  558. >Machine.
  559.  
  560. Ah, well that's the kicker.  Most men don't seem to let any of that stop
  561. them.  
  562.  
  563. -Scott
  564. - ------------------                         Physics is not a religion.  If
  565. Scott I. Chase                               it were, we'd have a much easier
  566. SICHASE@CSA2.LBL.GOV                         time raising money. -Leon Lederman
  567.  
  568. +++++++++++++++++++++++++++
  569.  
  570. >From mikeh@kralizec.zeta.org.au (Michael Hore)
  571. Date: 27 Mar 1994 12:56:33 +1000
  572. Organization: Kralizec Dialup Unix Sydney: +61-2-837-1183 V.32bis
  573.  
  574.  
  575. Yesterday I wrote:
  576.  
  577. >My son is studying CS at university - I must check with him to see
  578. >if the ratio is higher there, so that we could say that there's
  579. >any sort of trend.
  580.  
  581. He said it's about 10:1 there - but most of the 10% females are from
  582. a non English-speaking background (Asian).  So it's possible that
  583. lack of confidence in English is another factor operating here.
  584.  
  585. This percentage isn't very different from what I remember when I
  586. studied CS nearly 20 years ago, except that the females then were
  587. all from an English-speaking background.  So at least in this part
  588. of the world, if we think the ratio of females "ought" to be rising,
  589. for some reason, then we have a problem.  It just isn't happening.
  590.  
  591. I know this has gone beyond what the original poster asked, but
  592. interesting nonetheless.
  593.  
  594. --  Mike.
  595.  
  596. - --------------------------------------------------------
  597. Mike Hore          mikeh@kralizec.zeta.org.au
  598. .sig deliberately kept short to minimize .sig/noise ratio.
  599. - --------------------------------------------------------
  600.  
  601. +++++++++++++++++++++++++++
  602.  
  603. >From mikeh@kralizec.zeta.org.au (Michael Hore)
  604. Date: 29 Mar 1994 16:55:02 +1000
  605. Organization: Kralizec Dialup Unix Sydney: +61-2-837-1183 V.32bis
  606.  
  607.  
  608. susanlesch@aol.com (SusanLesch) writes:
  609.  
  610. >  In your own experience, how many females regularly answer
  611. >  programming and technical questions in this newsgroup? I
  612. >  mean women who often answer (rather than ask) questions
  613. >  about programming (or, failing that, anything you would
  614. >  term "technical").
  615. >
  616. >  As determined informally in 1993 by a source I cannot
  617. >  reveal, there were approximately two qualifiers in
  618. >  Macintosh programming on the entire Internet.
  619.  
  620. I've been reading c.s.m.p for a couple of years now, and I'd have to
  621. say that that's two more than I've ever noticed.
  622.  
  623. But I've been to a number of Mac developers' meetings here in
  624. Sydney, Australia, and the ratio there was more like 10:1.
  625.  
  626. My son is studying CS at university - I must check with him to see
  627. if the ratio is higher there, so that we could say that there's
  628. any sort of trend.
  629.  
  630. As another poster said, I suspect there's a reluctance to get involved
  631. in a Usenet group with all the flamage etc. that goes on.
  632.  
  633. [...snip...]
  634. >  I do not mean to suggest that these 1000:1? ratios
  635. >  reflect all working programmers! I am curious to know if
  636. >  my source re: the Internet was being facetious or rather,
  637. >  as I tend to suspect, being fairly accurate.
  638.  
  639. Looks accurate to me.
  640.  
  641. >Thanks very much for any replies,
  642. >Susan Lesch
  643. >(an Internet and C novice)
  644.  
  645. Welcome!
  646.  
  647. --  Mike.
  648.  
  649. - --------------------------------------------------------
  650. Mike Hore          mikeh@kralizec.zeta.org.au
  651. .sig deliberately kept short to minimize .sig/noise ratio.
  652. - --------------------------------------------------------
  653.  
  654. +++++++++++++++++++++++++++
  655.  
  656. >From mikeh@kralizec.zeta.org.au (Michael Hore)
  657. Date: 29 Mar 1994 12:56:33 +1000
  658. Organization: Kralizec Dialup Unix Sydney: +61-2-837-1183 V.32bis
  659.  
  660.  
  661. Yesterday I wrote:
  662.  
  663. >My son is studying CS at university - I must check with him to see
  664. >if the ratio is higher there, so that we could say that there's
  665. >any sort of trend.
  666.  
  667. He said it's about 10:1 there - but most of the 10% females are from
  668. a non English-speaking background (Asian).  So it's possible that
  669. lack of confidence in English is another factor operating here.
  670.  
  671. This percentage isn't very different from what I remember when I
  672. studied CS nearly 20 years ago, except that the females then were
  673. all from an English-speaking background.  So at least in this part
  674. of the world, if we think the ratio of females "ought" to be rising,
  675. for some reason, then we have a problem.  It just isn't happening.
  676.  
  677. I know this has gone beyond what the original poster asked, but
  678. interesting nonetheless.
  679.  
  680. --  Mike.
  681.  
  682. - --------------------------------------------------------
  683. Mike Hore          mikeh@kralizec.zeta.org.au
  684. .sig deliberately kept short to minimize .sig/noise ratio.
  685. - --------------------------------------------------------
  686.  
  687. +++++++++++++++++++++++++++
  688.  
  689. >From rba26@cas.org (Brad Andrews)
  690. Date: Fri, 8 Apr 1994 16:31:05 GMT
  691. Organization: Chemical Abstracts Service
  692.  
  693. In article 60l@kralizec.zeta.org.au, mikeh@kralizec.zeta.org.au (Michael Hore) writes:
  694. [snip]
  695. ]
  696. ]As another poster said, I suspect there's a reluctance to get involved
  697. ]in a Usenet group with all the flamage etc. that goes on.
  698. ]
  699. [snip]
  700.  
  701. I have been flamed quite a few times by women on other forums, so I doubt
  702. that is the sole reason.  :)
  703.  
  704. - -
  705.  
  706. Brad Andrews
  707. Brad.Andrews@cas.org
  708. All opinions are strictly mine
  709.  
  710.  
  711. ---------------------------
  712.  
  713. >From perdue@csn.org (James "Newt" Perdue)
  714. Subject: HELP - PICT File ColorTables and Palettes
  715. Date: 7 Apr 1994 10:50:49 -0500
  716. Organization: UTexas Mail-to-News Gateway
  717.  
  718. I'm pulling my hair out over this one: I'm trying to read Pict files,
  719. display them and have their colors be accurate (256 colors):
  720.  
  721. I read a PICT file that I created in PhotoShop. 
  722.  
  723. I use DrawPicture to transfer it to an off-screen GWorld.
  724.  
  725. I use the Picture Utilities GetPictInfo to return a Palette.
  726.  
  727. I install the Palette and everything is great! Colors are correct.
  728.  
  729. BUT....
  730.  
  731. The Picture Utilities takes TOO LONG for a commercial application I am
  732. building.  So,  I need a way to merely access the color table that comes
  733. along with the Pict file and build my own Palette.  Looking at the pmTable
  734. field in the offscreen GWORLD after I do the DrawPicture, it doesn't change
  735. from Pict to Pict.  WHAT TO DO???  I can't believe that there is not a way
  736. to access the colortable directly from the Pict.  
  737.  
  738. I am in desperate need to meet a deadline on this one. Any help would be
  739. appreciated. (The person to help me solve it will get a free CD-ROM I am
  740. developing!)
  741.  
  742. Thanks
  743.  
  744. Newt Perdue
  745.  
  746. Newt Perdue                                           rmdp@csn.org
  747. Rocky Mountain Digital Peeks                        1-303-258-3779
  748. PO Box 1576                                    
  749. Nederland, CO 80466 
  750.  
  751.  
  752.  
  753. +++++++++++++++++++++++++++
  754.  
  755. >From Carl R. Osterwald <carl_osterwald@nrel.gov>
  756. Date: Thu, 7 Apr 94 18:13:42 GMT
  757. Organization: National Renewable Energy Laboratory
  758.  
  759. In article <199404071550.AA22028@teal.csn.org> James, perdue@csn.org
  760. writes:
  761. >from Pict to Pict.  WHAT TO DO???  I can't believe that there is not a
  762. way
  763. >to access the colortable directly from the Pict.  
  764.  
  765. It is possible, although it may not be entirely easy.  You need to root
  766. through the PICT data looking for opcodes $0090 or $0098, which are for
  767. rect-clipped CopyBits, to find the offset to the color table.  The first
  768. block of data for these opcodes is the PixMap, which $32 bytes long. 
  769. Following the PixMap is the color table.  Assuming the PICT file just
  770. contains a PixMap from PhotoShop, you might be able to get away with
  771. parsing just a few of the opcodes listed in IM Vol. V to get to the
  772. CopyBits portion.  If not, you will need to parse most or all of the
  773. opcodes.  Most are easy, but a number of them are variable length, which
  774. will complicate things.
  775.  
  776. +++++++++++++++++++++++++++
  777.  
  778. >From giles@med.cornell.edu (Aaron Giles)
  779. Date: Thu, 07 Apr 1994 17:10:59 -0500
  780. Organization: Cornell University Medical College
  781.  
  782. In article <A9C99B66E0017D1A@cro.nrel.gov>, Carl R. Osterwald
  783. <carl_osterwald@nrel.gov> wrote:
  784.  
  785. > In article <199404071550.AA22028@teal.csn.org> James, perdue@csn.org
  786. > writes:
  787. > >from Pict to Pict.  WHAT TO DO???  I can't believe that there is not a
  788. > >way to access the colortable directly from the Pict.  
  789. > It is possible, although it may not be entirely easy.  You need to root
  790. > through the PICT data looking for opcodes $0090 or $0098, which are for
  791. > rect-clipped CopyBits, to find the offset to the color table.....
  792.  
  793. No, no, no!  There is a completely clean, fast way of doing just what you
  794. want.  It's called the QuickDraw Bottleneck, and if you deal with PICTs
  795. extensively, you'll need to know how to do it.  For this case, you write a
  796. StdBits bottleneck, which gets called whenever a CopyBits is performed in
  797. the port, and in that bottleneck, you copy out the color table of the
  798. source PixMap (since that's where the color data is coming from).  The
  799. code will look something like this:
  800.  
  801. CTabHandle gMyColors;
  802.  
  803. CTabHandle MyGetPICTColors(myPicture)
  804. {
  805.    CQDProcs myProcs, *oldProcs;
  806.  
  807.    gMyColors = nil;                   // nil result in case no colors found
  808.    SetPort(myDummyPort);              // point to where drawing won't be seen
  809.    SetStdCProcs(&myProcs);            // set up standard pointers
  810.    myProcs.bitsProc = MyStdBitsProc;  // use UPP here if compiling for PowerPC
  811.    oldProcs = myDummyPort->grafProcs; // save old bottlenecks
  812.    myDummyPort->grafProcs = &myProcs; // install our new bottlenecks
  813.    DrawPicture(myPicture, &destRect); // this does all the magic
  814.    myDummyPort->grafProcs = oldProcs; // restore old bottlenecks
  815.    return gMyColors;                  // return the global result
  816. }
  817.  
  818. pascal void MyStdBitsProc(BitMap *srcMap, Rect *srcRect, Rect *dstRect,
  819.          short tMode, RgnHandle maskRgn)
  820. {
  821.    PixMapPtr thePixMap = (PixMapPtr)srcMap; // cast as a PixMapPtr
  822.  
  823.    if (thePixMap->rowBytes & 0x8000) { // verify that this is a color source
  824.       gMyColors = thePixMap->pmTable;  // get the color table handle
  825.       HandToHand(&gMyColors);          // make a copy
  826.    }
  827. }
  828.  
  829. Note that there's no error checking or niceties here, but this shows you
  830. the general technique.
  831.  
  832. Aaron
  833. -- 
  834. Aaron Giles
  835. Power Macintosh & Newton developer
  836. Cornell University Medical College
  837. giles@med.cornell.edu
  838.  
  839. ---------------------------
  840.  
  841. >From lehmann@bert.cs.byu.edu (Ralf Lehmann)
  842. Subject: Max # of open files
  843. Date: 25 Mar 1994 22:53:08 GMT
  844. Organization: Brigham Young University
  845.  
  846. >From inside my program, it seems I can only open about 12 files
  847. simultaneously.  What do I need to do (Toolbox call, Control
  848. Panel, whatever...) to open more files than that ?
  849.  
  850. Thanks,
  851. Ralf.
  852.  
  853. +++++++++++++++++++++++++++
  854.  
  855. >From sro@media.mit.edu (Shawn O'Donnell)
  856. Date: Sat, 26 Mar 1994 01:45:19 GMT
  857. Organization: M.I.T. Media Laboratory
  858.  
  859. > it seems I can only open about 12 files simultaneously.  What do I
  860. >  need to do... to open more files than that ?
  861.  
  862. You can set that in your AUTOEXEC.BAT file.
  863.  
  864.  :)
  865.  
  866. --Shawn
  867.  
  868. P.S.  Do you know why you can't open more?  Are you running out of 
  869. memory?  Running out of pointers?  Try calling MoreMasters() and/or
  870. allocating more RAM to the program.  
  871.  
  872. +++++++++++++++++++++++++++
  873.  
  874. >From devon_hubbard@taligent.com (Devon Hubbard)
  875. Date: Fri, 25 Mar 1994 23:15:25 GMT
  876. Organization: Taligent, Inc.
  877.  
  878. In article <lehmann-250394155007@babbage.cs.byu.edu>,
  879. lehmann@bert.cs.byu.edu (Ralf Lehmann) wrote:
  880.  
  881. > From inside my program, it seems I can only open about 12 files
  882. > simultaneously.  What do I need to do (Toolbox call, Control
  883. > Panel, whatever...) to open more files than that ?
  884. > Thanks,
  885. > Ralf.
  886.  
  887. Are you using ANSI lib calls or regular toolbox OS calls?  If you are using
  888. ANSI (and I'll assume for a moment MPW) then StdCLib's limit of 20 open
  889. files at a time still isn't your problem.  If you are using regular toolbox
  890. calls you still shouldn't have a problem opening 12 files.  Do you have a
  891. ton of fonts in your system?  If you are under System 7, that shouldn't be
  892. a problem.
  893.  
  894. Can you be specific about why you can't open more than 12 files.  What
  895. error codes are you getting back, etc?
  896.  
  897. - ------------------------------------------------------------------------
  898. Devon Hubbard                                                Silicon Pilot
  899. devon_hubbard@taligent.com                                   Taligent, Inc
  900.  
  901. +++++++++++++++++++++++++++
  902.  
  903. >From Aaron Bratcher <aaron_bratcher@fpm.uchicago.edu>
  904. Date: Sat, 26 Mar 1994 14:01:31 GMT
  905. Organization: University of Chicago
  906.  
  907. In article <SRO.94Mar25204519@media-lab.media.mit.edu> Shawn O'Donnell, sro@media.mit.edu writes:
  908. >You can set that in your AUTOEXEC.BAT file.
  909.  
  910. That should be the CONFIG.SYS file  ;)
  911.  
  912. - ------------------------------------------------------------------------
  913.      MegaWatt                         |    _____  _____  _____   _   _ 
  914.                                       |   |__  / | ___ || ___ \ | | | |
  915. AKA  Aaron L. Bratcher                |     / /  | |_| || |_/ / | | | |
  916.      University of Chicago            |    / /__ | ___ ||  __/  |_| |_|
  917.      aaron_bratcher@fpm.uchicago.edu  |   |_____||_| |_||_|     (_) (_)
  918. - ------------------------------------------------------------------------
  919.  
  920. +++++++++++++++++++++++++++
  921.  
  922. >From lehmann@bert.cs.byu.edu (Ralf Lehmann)
  923. Date: 29 Mar 1994 17:19:44 GMT
  924. Organization: Brigham Young University
  925.  
  926. OK, OK, here some more information about what I'm trying to do:
  927. I use Think C 5.0, I need to use portable functions, that's why
  928. I use open or fopen from the ANSI library.  Following your
  929. suggestions, I tried to replace the open function by the Create
  930. function, and indeed, it worked (I aborted the program after 500
  931. had been created... what a mess to put them in the trash can...)
  932. So it seems that Think C's library is at fault.  Why would it
  933. limit the # of open files ? Isn't it just calling Create or FSOpen ?
  934. Here is my little test program:
  935.  
  936. #include <stdio.h>
  937. #include <unix.h>
  938. #include <fcntl.h>
  939.  
  940. void main ()
  941.     {
  942.     int i;
  943.     char name[5];
  944.         
  945.     for (i = 0; ; i++)
  946.         {
  947.         sprintf (name, "_t%d", i);
  948.         if (open (name, O_CREAT) == -1) break;
  949.         }
  950.     printf ("max open files: %d\n", i);
  951.     }
  952.  
  953. +++++++++++++++++++++++++++
  954.  
  955. >From leblonk@netcom.com (Marcel Blonk)
  956. Date: Tue, 29 Mar 1994 21:59:31 GMT
  957. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  958.  
  959. : So it seems that Think C's library is at fault.  Why would it
  960. : limit the # of open files ? Isn't it just calling Create or FSOpen ?
  961.  
  962. Under system 6, the number of open files on a mac is limited. With the 
  963. standard configuration, you would be able to open about 12 files (that 
  964. is, depending on how many other files are opened by the system and other 
  965. apps). One way to fix this is by using SuitCase, which has a power user 
  966. setting somewhere that allows you to up the max # of open files.
  967. This I know for sure.
  968. What I don't know for sure:
  969. I think/seem_to_remember that under system 7 the FCB's are dynamically 
  970. allocated, so there is no longer a limit to the number of open files. 
  971. Again, I'm not sure. Are you using system 7?
  972.  
  973. Btw. I think the reason why your little test program works is because you 
  974. only create files, but you do not actually keep them open.
  975.  
  976. Marcel
  977.  
  978.  
  979. +++++++++++++++++++++++++++
  980.  
  981. >From rollin@newton.apple.com (Keith Rollin)
  982. Date: Fri, 1 Apr 1994 06:58:37 GMT
  983. Organization: Little to none
  984.  
  985. In article <lehmann-250394155007@babbage.cs.byu.edu>,
  986. lehmann@bert.cs.byu.edu (Ralf Lehmann) wrote:
  987.  
  988. > From inside my program, it seems I can only open about 12 files
  989. > simultaneously.  What do I need to do (Toolbox call, Control
  990. > Panel, whatever...) to open more files than that ?
  991.  
  992. Sounds like you're using C's stdio. There's this comment thing inside of
  993. StdIO.h that you might want to read:
  994.  
  995. /*
  996.  *    The minimum number of files that a program is guaranteed to be able to
  997. have
  998.  *    open simultaneously (including the pre-opened stdin, stdout, and
  999. stderr).
  1000.  *    The numbers are listed in Inside Macintosh, page IV-178, as:
  1001.  *    64K ROM, 128K Macintosh        12 files
  1002.  *    64K ROM, 512K Macintosh        40 files
  1003.  *    128K ROM                    40 files per volume
  1004.  */
  1005.  
  1006. #define FOPEN_MAX    12
  1007.  
  1008. That's from MPW. Symantec C 6.0 sets this to 15, without any comments.
  1009.  
  1010. How do you fix this? If you're using MPW, you'll probably have to rewrite
  1011. your program to either a) live with the limit or b) using the File Manager
  1012. calls. If you're using THINK C, you can probably just recompile the
  1013. libraries.
  1014.  
  1015. - --------------------------------------------------------------------------
  1016. Keith Rollin --- Phantom Programmer --- Apple Computer, Inc. --- Team
  1017. Newton
  1018.  
  1019. +++++++++++++++++++++++++++
  1020.  
  1021. >From neeri@iis.ee.ethz.ch (Matthias Neeracher)
  1022. Date: 7 Apr 94 11:02:25
  1023. Organization: Integrated Systems Laboratory, ETH, Zurich
  1024.  
  1025. In article <rollin-310394225838@rollin-keith.apple.com>, rollin@newton.apple.com (Keith Rollin) writes:
  1026.  
  1027. > In article <lehmann-250394155007@babbage.cs.byu.edu>,
  1028. > lehmann@bert.cs.byu.edu (Ralf Lehmann) wrote:
  1029.  
  1030. >> From inside my program, it seems I can only open about 12 files
  1031. >> simultaneously.  What do I need to do (Toolbox call, Control
  1032. >> Panel, whatever...) to open more files than that ?
  1033.  
  1034. > Sounds like you're using C's stdio. There's this comment thing inside of
  1035. > StdIO.h that you might want to read:
  1036. >[...]
  1037. > #define FOPEN_MAX    12
  1038.  
  1039. > That's from MPW. Symantec C 6.0 sets this to 15, without any comments.
  1040.  
  1041. > How do you fix this? If you're using MPW, you'll probably have to rewrite
  1042. > your program to either a) live with the limit or b) using the File Manager
  1043. > calls.
  1044.  
  1045. Alternatively, you can do the following, at least with MPW 3.2 and MPW 3.3:
  1046.  
  1047. /* Allocate more stdio buffers */
  1048.  
  1049. FILE _iob[64] = {
  1050.     0, nil, nil, nil, 0, _IOREAD,         0,
  1051.     0, nil, nil, nil, 0, _IOWRT,          1,
  1052.     0, nil, nil, nil, 0, _IOWRT+_IOLBF,    2
  1053. };
  1054.     
  1055. FILE * _lastbuf = _iob + 64;
  1056.  
  1057. The Linker will warn you, forgive him if you know what you're doing :-)
  1058.  
  1059. Matthias
  1060.  
  1061. - ---
  1062. Matthias Neeracher                                  neeri@iis.ee.ethz.ch
  1063.   "And that's why I am going to turn this world upside down, and make
  1064.    of it a fire so *bright* that someone real will notice"
  1065.                                 -- Vernor Vinge, _Tatja Grimm's World_
  1066.  
  1067. ---------------------------
  1068.  
  1069. >From west@augsburg.edu (James West)
  1070. Subject: Proper QT PICT creation?
  1071. Date: 31 Mar 1994 20:59:20 GMT
  1072. Organization: Augsburg College
  1073.  
  1074. I am trying to create a custom interface for a digital camera that
  1075. downloads a JPEG (or JFIF) image via the serial port. So far, it is set up
  1076. so that an appleevent triggers the camera to snap a photo, and another
  1077. appleevent orders the camera to download the image. So far so good.
  1078.  
  1079. My challenge is to convert the photo to a QT PICT. Right now I have had
  1080. some success by canabalizing existing JPEG PICT's and pasting the opcodes
  1081. onto the JFIF data. I realize this is very bad technique, and would like to
  1082. be able to do this in a proper fashion.
  1083.  
  1084. I understand the basic process for creating a PICT file containing a
  1085. compressed image, but I am somewhat confused when it comes to the
  1086. imagedesc(?) structure that needs to be passed with the decompressImage
  1087. funtion. Since quicktime did not compress this image (which is usually when
  1088. the imagedesc is created), what do I use for this value? Can I steal a
  1089. imagedesc from an existing JPEG PICT and use that after some tweaking to my
  1090. specifications (height and width, ect.)? This option seems to kind of make
  1091. me a cannibal again. Are there published standards for creating this
  1092. structure?
  1093.  
  1094. I would also love to have this QT PICT version of this image pasted onto
  1095. the clipboard for further use. Is this supported and is there any way this
  1096. could be done with my image grabbing app in the background?
  1097.  
  1098. ANY pointers and/or kicks in the side of the head are welcome. Thanks
  1099.  
  1100. -- 
  1101. James West                             ***** I like Cacti... ****
  1102. Augsburg College Graphic Center
  1103. 731 21st Ave S
  1104. Mpls. MN 55454        
  1105. west@augsburg.edu                      ********  OUTCH!! ********
  1106.  
  1107. +++++++++++++++++++++++++++
  1108.  
  1109. >From markhanrek@aol.com (MarkHanrek)
  1110. Date: 1 Apr 1994 13:31:04 -0500
  1111. Organization: America Online, Inc. (1-800-827-6364)
  1112.  
  1113. On the QuickTime CD, there is source code for taking a standard JFIF file, and
  1114. feeding it to one of the Quicktime routines, FDecompress I believe, so that you
  1115. end up with a normal everyday PixMap of the image.
  1116.  
  1117. ( Note that the resulting image quality is not as good as is obtainable with
  1118. the standard JPEG decompression routines available from the Independent JPEG
  1119. Group (uunet.uu.net) . This may change with the impending release of QuickTime
  1120. 2.0 ).
  1121.  
  1122. At this point, you have a straight pixmap of your image, and the following
  1123. "intermediate" steps have nothing to do with QuickTime, or JPEG. 
  1124.  
  1125. You have a PixMap of the image, and you can easily turn it into a Macintosh
  1126. picture using the standard method of opening a new picture and copybitsing the
  1127. image to itself, and closing the picture, yielding a picture.
  1128.  
  1129. You can save this picture to the clipboard, draw it to the screen, or write it
  1130. to a PICT file.
  1131.  
  1132. To put it on disk as a QT Compressed PICT, you use additional functions found
  1133. in the QuickTime toolkit to compress the pixmap and write out a QT compressed
  1134. file.
  1135.  
  1136. If at all possible, you really do want try to stand on the shoulders of the
  1137. routines provided along with the QuickTime CD's example source code.
  1138.  
  1139. I have done a wide variety of things in this regard, and I couldn't answer your
  1140. question about ImageDescriptors, most likely because I took the example source
  1141. code and treated it as a black box, and have never had to deal with knowing
  1142. these details, thank god! :)
  1143.  
  1144. See if you can't get a hold of the stuff on the QuickTime Developer's Toolkit
  1145. CD. ( or whatever it is called exactly ).
  1146.  
  1147. Hope this helps.
  1148.  
  1149. Mark Hanrek
  1150.  
  1151.  
  1152. +++++++++++++++++++++++++++
  1153.  
  1154. >From Steve Bryan <sbryan@maroon.tc.umn.edu>
  1155. Date: Sat, 2 Apr 1994 05:14:22 GMT
  1156. Organization: Sexton Software
  1157.  
  1158. In article <west-310394144925@141.224.192.172> James West,
  1159. west@augsburg.edu writes:
  1160. >I understand the basic process for creating a PICT file containing a
  1161. >compressed image, but I am somewhat confused when it comes to the
  1162. >imagedesc(?) structure that needs to be passed with the decompressImage
  1163. >funtion. Since quicktime did not compress this image (which is usually
  1164. when
  1165. >the imagedesc is created), what do I use for this value? Can I steal a
  1166. >imagedesc from an existing JPEG PICT and use that after some tweaking to
  1167. my
  1168. >specifications (height and width, ect.)? This option seems to kind of
  1169. make
  1170. >me a cannibal again. Are there published standards for creating this
  1171. >structure?
  1172.  
  1173. You're probably already aware of it but just in case (and for others)
  1174. there is significant discussion of this topic in Inside Macintosh:
  1175. QuickTime starting on page 3-24. A good (the best?) general reference for
  1176. JPEG  is "JPEG Still Image Data Compression Standard" by Pennebaker and
  1177. Mitchell from Van Nostrand (ISBN 0-442-01272-1). If you're looking for
  1178. the book in Minneapolis try Borders Books at Hennepin & Lake, they have
  1179. it in stock.
  1180. Steve Bryan                  InterNet: sbryan@maroon.tc.umn.edu
  1181. Sexton Software            CompuServe: 76545,527
  1182. Minneapolis, MN                   Fax: (612) 929-1799
  1183.  
  1184. +++++++++++++++++++++++++++
  1185.  
  1186. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1187. Date: 5 Apr 94 12:40:49 +1300
  1188. Organization: University of Waikato, Hamilton, New Zealand
  1189.  
  1190. In article <2nhp98$8am@search01.news.aol.com>, markhanrek@aol.com (MarkHanrek) writes:
  1191. > On the QuickTime CD, there is source code for taking a standard JFIF file, and
  1192. > feeding it to one of the Quicktime routines, FDecompress I believe, so that you
  1193. > end up with a normal everyday PixMap of the image.
  1194. >
  1195. ...
  1196. >
  1197. > You have a PixMap of the image, and you can easily turn it into a Macintosh
  1198. > picture using the standard method of opening a new picture and copybitsing the
  1199. > image to itself, and closing the picture, yielding a picture.
  1200. >
  1201. > You can save this picture to the clipboard, draw it to the screen, or write it
  1202. > to a PICT file.
  1203. >
  1204. > To put it on disk as a QT Compressed PICT, you use additional functions found
  1205. > in the QuickTime toolkit to compress the pixmap and write out a QT compressed
  1206. > file.
  1207.  
  1208. Note that the decompress calls are drawing calls. This means that, if you have
  1209. a QuickDraw picture open, the _compressed_ data will be recorded directly in
  1210. the picture. This is better than decompressing the data into a PixMap, and
  1211. then recompressing it, with the consequent loss of even more image quality.
  1212.  
  1213. I do actually have some code somewhere that fakes an ImageDescription structure
  1214. for a JPEG image. I think it still works. :-)
  1215.  
  1216. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  1217. Info & Tech Services Division              fax: +64-7-838-4066
  1218. University of Waikato            electric mail: ldo@waikato.ac.nz
  1219. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  1220.  
  1221. +++++++++++++++++++++++++++
  1222.  
  1223. >From west@augsburg.edu (James West)
  1224. Date: 5 Apr 1994 16:57:28 GMT
  1225. Organization: Augsburg College
  1226.  
  1227. Great replies- thanks folks! Here's where I'm at...
  1228.  
  1229. > Note that the decompress calls are drawing calls. This means that, if you have
  1230. > a QuickDraw picture open, the _compressed_ data will be recorded directly in
  1231. > the picture. This is better than decompressing the data into a PixMap, and
  1232. > then recompressing it, with the consequent loss of even more image quality.
  1233. > I do actually have some code somewhere that fakes an ImageDescription structure
  1234. > for a JPEG image. I think it still works. :-)
  1235.  
  1236. I did end up going this route, because I did want the data to be compressed
  1237. and avoid the data loss of recompression. The ImageDescription that I
  1238. created also seems to work fine for the DecompressImage call recorded to a
  1239. picture. I don't think there should be a problem using this option in this
  1240. application, since the resolution and depth of my JPEG data from this
  1241. camera will always be constant.
  1242.  
  1243. My only problem now is trying to get the picture pasted to the clipboard
  1244. when this application is running in the background. Works fine when it's a
  1245. foreground app, but while backgrounding it either silently fails to get the
  1246. picture onto the scrap, or drops into MacsBug (but that may be another
  1247. problem :-(   ).
  1248. -- 
  1249.  
  1250. James West                             ***** I like Cacti... ****
  1251. Augsburg College Graphic Center
  1252. 731 21st Ave S
  1253. Mpls. MN 55454        
  1254. west@augsburg.edu                      ********  OUTCH!! ********
  1255.  
  1256. +++++++++++++++++++++++++++
  1257.  
  1258. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1259. Date: 7 Apr 94 11:34:24 +1300
  1260. Organization: University of Waikato, Hamilton, New Zealand
  1261.  
  1262. In article <1994Apr5.124049.27222@waikato.ac.nz>, I said:
  1263. >
  1264. > Note that the decompress calls are drawing calls. This means that, if you have
  1265. > a QuickDraw picture open, the _compressed_ data will be recorded directly in
  1266. > the picture. This is better than decompressing the data into a PixMap, and
  1267. > then recompressing it, with the consequent loss of even more image quality.
  1268. >
  1269. > I do actually have some code somewhere that fakes an ImageDescription structure
  1270. > for a JPEG image. I think it still works. :-)
  1271.  
  1272. OK, here are some relevant extracts from a quick-and-dirty tool I wrote a
  1273. couple of years ago for turning JPEG files into PICT files. I discovered very
  1274. little of this information myself: in particular, Dolf Starreveld at Storm
  1275. Technologies was kind enough to tell me enough about JPEG and JFIF formats to
  1276. make this work.
  1277.  
  1278. Note: "JpegData" points to a buffer containing the contents of the JPEG
  1279. file. The number of bytes is in "JpegDataSize". First you need to scan this,
  1280. looking for the bounds of the image. You don't really need the whole file for
  1281. this: the information should be present somewhere within the first 1K:
  1282.  
  1283.     PROCEDURE FindPictureSize;
  1284.       (* scans the JPEG data, looking for the information about
  1285.     the dimensions of the image. *)
  1286.  
  1287.     VAR
  1288.         NextByte, DataEnd : ADDRESS;
  1289.         TwoBytes :
  1290.         RECORD
  1291.         CASE : CARDINAL OF
  1292.         | 1:
  1293.             HighByte, LowByte : BYTE;
  1294.         | 2:
  1295.             SignedWord : INTEGER
  1296.         END (*CASE*)
  1297.         END (*RECORD*);
  1298.         Msg, TempStr : Str255;
  1299.  
  1300.     BEGIN
  1301.     NextByte := JpegData;
  1302.     DataEnd := JpegData + JpegDataSize;
  1303.     LOOP
  1304.         IF NextByte = DataEnd THEN
  1305.         ErrorLiteral('couldnUt determine JPEG image bounds', ProcessingError);
  1306.         EXIT
  1307.         END (*IF*);
  1308.         IF ORD(NextByte^) = 0FFH THEN
  1309.         INC(NextByte);
  1310.         IF NextByte = DataEnd THEN
  1311.             ErrorLiteral('malformed JPEG file', ProcessingError);
  1312.             EXIT
  1313.         END (*IF*);
  1314.         IF ORD(NextByte^) = 0C0H THEN
  1315.             INC(NextByte);
  1316.             IF DataEnd - NextByte >= 7 THEN
  1317.             NextByte := NextByte + 3;
  1318.             TwoBytes.HighByte := NextByte^;
  1319.             INC(NextByte);
  1320.             TwoBytes.LowByte := NextByte^;
  1321.             INC(NextByte);
  1322.             PictureSize.v := TwoBytes.SignedWord;
  1323.             TwoBytes.HighByte := NextByte^;
  1324.             INC(NextByte);
  1325.             TwoBytes.LowByte := NextByte^;
  1326.             INC(NextByte);
  1327.             PictureSize.h := TwoBytes.SignedWord;
  1328.             MakeCounted('Image size (h, v) = (', Msg);
  1329.             NumToString(PictureSize.h, TempStr);
  1330.             AppendCounted(ADR(TempStr), Msg);
  1331.             AppendtoCounted(', ', Msg);
  1332.             NumToString(PictureSize.v, TempStr);
  1333.             AppendCounted(ADR(TempStr), Msg);
  1334.             AppendtoCounted(')', Msg);
  1335.             ErrorString(Msg, Success);
  1336.             EXIT
  1337.             ELSE
  1338.             ErrorLiteral('malformed bounds info', ProcessingError);
  1339.             EXIT
  1340.             END (*IF*)
  1341.         END (*IF*)
  1342.         ELSE
  1343.         INC(NextByte)
  1344.         END (*IF*)
  1345.     END (*LOOP*)
  1346.     END FindPictureSize;
  1347.  
  1348. Then, you build the fake ImageDescription and record the data into a
  1349. picture:
  1350.  
  1351.     PROCEDURE BuildPicture;
  1352.  
  1353.     VAR
  1354.         Description : ImageDescriptionHandle;
  1355.         PictureBounds : Rect;
  1356.         TempPort : CGrafPort;
  1357.  
  1358.     BEGIN (*BuildPicture*)
  1359.     Description := NewHandle(SIZE(ImageDescription));
  1360.     Description^^.idSize := SIZE(ImageDescription);
  1361.     Description^^.cType := 06A706567H (* 'jpeg' *);
  1362.     Description^^.resvd1 := 0;
  1363.     Description^^.resvd2 := 0;
  1364.     Description^^.dataRefIndex := 0;
  1365.     Description^^.version := 0;
  1366.     Description^^.revisionLevel := 0;
  1367.     Description^^.vendor := 06170706CH (* 'appl' *);
  1368.     Description^^.temporalQuality := ImageCompression.codecMinQuality;
  1369.     Description^^.spatialQuality := ImageCompression.codecNormalQuality; (* is this significant? *)
  1370.     Description^^.width := PictureSize.h;
  1371.     Description^^.height := PictureSize.v;
  1372.     Description^^.hRes := FixRatio(72, 1);
  1373.     Description^^.vRes := FixRatio(72, 1);
  1374.     Description^^.dataSize := JpegDataSize;
  1375.     Description^^.frameCount := 1;
  1376.     Description^^.name[0] := 0C;
  1377.     Description^^.depth := 32; (* I hope! *)
  1378.     Description^^.clutID := -1;
  1379.     OpenCPortVar(TempPort);
  1380.     PictureBounds.top := 0;
  1381.     PictureBounds.left := 0;
  1382.     PictureBounds.botRight := PictureSize;
  1383.     ClipRect(PictureBounds);
  1384.     Picture := OpenPicture(PictureBounds);
  1385.     Err := DecompressImage
  1386.       (
  1387.         (*data :=*) JpegData,
  1388.         (*desc :=*) Description,
  1389.         (*dst :=*) TempPort.portPixMap,
  1390.         (*srcRect :=*) ADR(PictureBounds),
  1391.         (*@dstRect :=*) PictureBounds,
  1392.         (*mode :=*) QuickDraw.ditherCopy,
  1393.         (*mask :=*) NIL
  1394.       );
  1395.     ClosePicture;
  1396.     IF Err <> noErr THEN
  1397.         OSError(Err)
  1398.     END (*IF*);
  1399.     CloseCPortVar(TempPort);
  1400.     DisposeHandle(Description)
  1401.     END BuildPicture;
  1402.  
  1403. Hope that helps.
  1404.  
  1405. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  1406. Info & Tech Services Division              fax: +64-7-838-4066
  1407. University of Waikato            electric mail: ldo@waikato.ac.nz
  1408. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  1409.  
  1410. ---------------------------
  1411.  
  1412. >From heilei@colossus.cs.hut.fi (Heikki Leinonen)
  1413. Subject: Q: Changing font & size of dialog items
  1414. Date: 31 Mar 1994 13:18:34 GMT
  1415. Organization: Helsinki University of Technology, Finland
  1416.  
  1417.  
  1418.   Greetings from the depths of Dialog Manager
  1419.  
  1420.   (possible FAQ alert...)
  1421.  
  1422.   So I make my DLOGs and DITLs with ResEdit, call GetNewDialog
  1423.   and ModalDialog in my program and so on. And then comes the
  1424.   tough part: is there a SIMPLE way to make *all* the texts
  1425.   (meaning static and edit texts, button and check box titles etc.)
  1426.   in my dialog something else than Chicago 12?  SetDAFont seems
  1427.   to handle only the font name, not the size. And it won't
  1428.   change the controls. If I created the controls myself, I could
  1429.   add the useWFont constant to controls' definition values. But
  1430.   making the layout with ResEdit is SOOOOO easy...
  1431.  
  1432.   Anyone have any bright ideas on this one? 
  1433.  
  1434.  
  1435.   Heikki Leinonen
  1436.  
  1437.   heilei@otax.tky.hut.fi
  1438.   Helsinki University of Technology
  1439.   Finland
  1440.  
  1441.  
  1442.  
  1443.  
  1444. +++++++++++++++++++++++++++
  1445.  
  1446. >From resnick@cogsci.uiuc.edu (Pete Resnick)
  1447. Date: Thu, 31 Mar 1994 12:06:05 -0600
  1448. Organization: University of Illinois at Urbana-Champaign
  1449.  
  1450. In article <2neija$i2@nntp.hut.fi>, heilei@colossus.cs.hut.fi (Heikki
  1451. Leinonen) wrote:
  1452.  
  1453. >  So I make my DLOGs and DITLs with ResEdit, call GetNewDialog
  1454. >  and ModalDialog in my program and so on. And then comes the
  1455. >  tough part: is there a SIMPLE way to make *all* the texts
  1456. >  (meaning static and edit texts, button and check box titles etc.)
  1457. >  in my dialog something else than Chicago 12?
  1458.  
  1459. You need to create an ictb resource. Unfortunately, ResEdit does not have
  1460. an ictb editor. Resourserer (sp?) is able to create them, or you can use
  1461. Rez.
  1462.  
  1463. pr
  1464. -- 
  1465. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  1466. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  1467. System manager - Cognitive Science Group, Beckman Institute, UIUC
  1468. Internet: resnick@cogsci.uiuc.edu
  1469.  
  1470. +++++++++++++++++++++++++++
  1471.  
  1472. >From Vampire@crypt.demon.co.uk (Vampire)
  1473. Date: Fri, 1 Apr 1994 00:41:37 GMT
  1474. Organization: Pennangalan Software
  1475.  
  1476.  
  1477. In article <2neija$i2@nntp.hut.fi> heilei@colossus.cs.hut.fi (Heikki Leinonen)
  1478. writes:
  1479. >  tough part: is there a SIMPLE way to make *all* the texts
  1480. >  (meaning static and edit texts, button and check box titles etc.)
  1481. >  in my dialog something else than Chicago 12?  SetDAFont seems
  1482. >  to handle only the font name, not the size. And it won't
  1483. >  change the controls.
  1484.  
  1485. All objects in a Dialog box use the font of the Dialog's GrafPort. SetDAFont()
  1486. changes a global setting for the font to use in ALL subsequent Dialog Manager
  1487. Windows. 
  1488.  
  1489. What you need to do is set the font and textsize of the GrafPort directly. The
  1490. way to do this is with the QuickDraw calls TextFont() and TextSize() [See IM
  1491. Vol 1 - p171]. These routines affect the ~current~ port, so you'll need to do
  1492. something like this...
  1493.  
  1494. [C Code]
  1495. DialogPtr    pMyDialog = GetNewDialog(blah blah blah);
  1496.  
  1497.     GetPort(&SavePort);
  1498.     SetPort(pMyDialog);
  1499.     TextFont(rhubarb);
  1500.     Textsize(baloney);
  1501.     SetPort(SavePort);
  1502.     ShowWindow(pMyDialog);
  1503.  
  1504. You need the code to save and restore the current grafport, as the Dialog
  1505. Manager normally does this for you, so it is probably missing from any code you
  1506. have written (DialogSelect() and ModalDialog() handle the grafports
  1507. automatically).
  1508.  
  1509. The above ~should~ work...I ~think~ it does for me, but I haven't written
  1510. anything recently that used it...
  1511.  
  1512. PS. If you only ant to change the text of editText items, you can do it by
  1513. directly modifying the contents of the Dialog's TERec structure...you can get
  1514. this by casting your DialogPtr to type DialogPeek, and dereferencing it as
  1515. follows:
  1516.  
  1517. TEHandle myDialogText = ((DialogPeek) pMyDialog)->textH;    [IM Vol 1, p408]
  1518.  
  1519. Best of luck...
  1520.  
  1521. =============================================================================
  1522.                                   |"If I knock on your door, you're a fool;
  1523.          VAMPIRE                  | if you invite me in, you're a dead fool"
  1524.   (Pennangalan Software)          |  My dust resides @crypt.demon.co.uk
  1525. =============================================================================
  1526.  
  1527. +++++++++++++++++++++++++++
  1528.  
  1529. >From t-gaul@i-link.com (Troy Gaul)
  1530. Date: Fri, 01 Apr 1994 14:04:27 -0600
  1531. Organization: I-Link, Ltd.
  1532.  
  1533. In article <84@crypt.demon.co.uk>, Vampire@crypt.demon.co.uk (Vampire)
  1534. wrote:
  1535.  
  1536. > In article <2neija$i2@nntp.hut.fi> heilei@colossus.cs.hut.fi (Heikki Leinonen)
  1537. > writes:
  1538. > >  tough part: is there a SIMPLE way to make *all* the texts
  1539. > >  (meaning static and edit texts, button and check box titles etc.)
  1540. > >  in my dialog something else than Chicago 12?  SetDAFont seems
  1541. > >  to handle only the font name, not the size. And it won't
  1542. > >  change the controls.
  1543. > All objects in a Dialog box use the font of the Dialog's GrafPort. SetDAFont()
  1544. > changes a global setting for the font to use in ALL subsequent Dialog Manager
  1545. > Windows. 
  1546. > What you need to do is set the font and textsize of the GrafPort directly. The
  1547. > way to do this is with the QuickDraw calls TextFont() and TextSize() [See IM
  1548. > Vol 1 - p171]. These routines affect the ~current~ port, so you'll need to do
  1549. > something like this...
  1550. > [C Code]
  1551. > DialogPtr    pMyDialog = GetNewDialog(blah blah blah);
  1552. >     GetPort(&SavePort);
  1553. >     SetPort(pMyDialog);
  1554. >     TextFont(rhubarb);
  1555. >     Textsize(baloney);
  1556. >     SetPort(SavePort);
  1557. >     ShowWindow(pMyDialog);
  1558.  
  1559. Actually, that will only change the Static and Edit text items, not the
  1560. controls (like buttons and checkboxes) in the dialog.  The only way that I
  1561. know of to change the font/size in the controls is to use CNTL resources
  1562. for each of those items and set the flag that tells the controls to use the
  1563. window's font.  (Note however that you must still change the port's
  1564. font/size for this to work.)
  1565.  
  1566. _troy
  1567. //////// //////___Troy Gaul_________________________t-gaul@i-link.com__ //
  1568.   //    //       I-Link, Ltd. ; West Des Moines, Iowa                  //
  1569.  //    //  //   "Iungo ergo sum." (I-Link, therefore I am.)           //
  1570. //    //////________________________________________________________ //
  1571.  
  1572. +++++++++++++++++++++++++++
  1573.  
  1574. >From resnick@cogsci.uiuc.edu (Pete Resnick)
  1575. Date: Fri, 01 Apr 1994 15:03:21 -0600
  1576. Organization: University of Illinois at Urbana-Champaign
  1577.  
  1578. In article <84@crypt.demon.co.uk>, Vampire@crypt.demon.co.uk (Vampire) wrote:
  1579.  
  1580. >All objects in a Dialog box use the font of the Dialog's GrafPort.
  1581. Not if you use an ictb resource.
  1582.  
  1583. pr
  1584. -- 
  1585. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  1586. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  1587. System manager - Cognitive Science Group, Beckman Institute, UIUC
  1588. Internet: resnick@cogsci.uiuc.edu
  1589.  
  1590. +++++++++++++++++++++++++++
  1591.  
  1592. >From dnewman@emx.cc.utexas.edu (David Newman)
  1593. Date: 1 Apr 1994 14:28:53 -0600
  1594. Organization: The University of Texas - Austin
  1595.  
  1596. In addition to what has been mentioned earlier, I was doing this the other
  1597. day, and I discovered an additional twist that noone has mentioned. If your
  1598. dialog includes an editable text box, you must set the text of that box to
  1599. the same text as the buttons (that is, the textFont must be the same for the
  1600. grafPort and for the TErec), otherwise, textedit will reset the font for the
  1601. grafPort.
  1602.  
  1603. Someone can correct me if they *know* better, since I'm a novice at such
  1604. things, but that was my diagnosis of the problem, and since I corrected
  1605. it, things work great.
  1606.  
  1607. >>Dave
  1608.  
  1609. P.S. Thanks to Leonard Rosenthal for pointing me in the right direction
  1610. when I had this problem, otherwise I wouldn't be able to answer.
  1611.  
  1612. +++++++++++++++++++++++++++
  1613.  
  1614. >From askwersk@athena.mit.edu (Adam Skwersky)
  1615. Date: 1 Apr 1994 19:39:36 GMT
  1616. Organization: Massachvsetts Institvte of Technology
  1617.  
  1618. In article <2neija$i2@nntp.hut.fi>, heilei@colossus.cs.hut.fi (Heikki
  1619. Leinonen) wrote:
  1620.  
  1621. >. If I created the controls myself, I could
  1622. >   add the useWFont constant to controls' definition values. But
  1623. >   making the layout with ResEdit is SOOOOO easy...
  1624. >   Anyone have any bright ideas on this one? 
  1625.  
  1626.  
  1627. I have had a similar problem. I was trying to use the custom Connection
  1628. Manager
  1629. Setup routines that add DITL's to your dialog and you use the DITL's to
  1630. setup up a certain tool. The items are all SUPPOSED to be in geneva 9, and
  1631. when you call the toolbox command CMChoose() thats what you get. However
  1632. if I were to add the DITL's to my OWN dialog, they all come out in
  1633. Chicago 12. I thought about trying to go through each dialog item and
  1634. changing its procID to procID+useWFont, but I could not even find the
  1635. procID field in the ControlHandle record! I'm really lost with this as
  1636. well,
  1637. and I do not think it is a FAQ. Do any Mac gurus out there know how to go
  1638. through a bunch of controls (dialog items) and change their fonts and
  1639. sizes?
  1640.  
  1641. Adam Skwersky
  1642. askwersk@mit.edu
  1643. adams@media.mit.edu
  1644.  
  1645. +++++++++++++++++++++++++++
  1646.  
  1647. >From hrodstein@aol.com (HRodstein)
  1648. Date: 2 Apr 1994 01:09:03 -0500
  1649. Organization: America Online, Inc. (1-800-827-6364)
  1650.  
  1651. I asked this question of Apple developer support a couple of months
  1652. ago. They told me I should use an ictb resource. This is documented
  1653. on page 279 of Inside Mac V. There are two problems.
  1654.  
  1655. First, neither ResEdit nor Rez know how to make ictb resources.
  1656. Resourcer does  know how to make it so you would either need
  1657. to hack it in hex or buy Resourcer.
  1658.  
  1659. Second, it will not work on machines without color QuickDraw
  1660. such as Mac Plus under System 6.
  1661.  
  1662. The technique of setting the font and text size of both the
  1663. dialog's grafPort and setting the font and text size of the
  1664. dialog's TextEdit record also seems to work if you want
  1665. to change editText and statText items only.
  1666.  
  1667. Howard Rodstein
  1668.  
  1669. +++++++++++++++++++++++++++
  1670.  
  1671. >From RobTerrell@aol.com (Rob Terrell)
  1672. Date: 4 Apr 1994 17:28:45 GMT
  1673. Organization: Jecta Development Corp.
  1674.  
  1675. In article <2nj25v$gfi@search01.news.aol.com>
  1676. hrodstein@aol.com (HRodstein) writes:
  1677.  
  1678. > First, neither ResEdit nor Rez know how to make ictb resources.
  1679. > Resourcer does  know how to make it so you would either need
  1680. > to hack it in hex or buy Resourcer.
  1681.  
  1682. I remember when I had to make these by hand a few years back...that was
  1683. no fun. So the real answer is...we need someone to cough up a ResEdit
  1684. 'ictb' editor.
  1685.  
  1686. Does anyone have such a beast they would be willing to contribute to
  1687. sumex?
  1688.  
  1689. Rob
  1690.  
  1691. +++++++++++++++++++++++++++
  1692.  
  1693. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  1694. Date: Thu, 7 Apr 1994 01:15:49 GMT
  1695. Organization: Apple Computer
  1696.  
  1697. Heikki Leinonen, heilei@colossus.cs.hut.fi writes:
  1698. >   is there a SIMPLE way to make *all* the texts
  1699. >   (meaning static and edit texts, button and check box titles etc.)
  1700. >   in my dialog something else than Chicago 12?
  1701.  
  1702. As has been said, you can use an 'ictb' resource. Unfortunately (maybe) these
  1703. aren't recognized on 68000 systems so if your program is supposed to run on
  1704. old hardware you can't use them.
  1705.  
  1706. One alternative thing I've done is to set the "useWFont" bit of the
  1707. variationCodes of the control items; this makes their text appear in the
  1708. current grafPort's font/size/style instead of the system font. Unfortunately,
  1709. to do this you have to temporarily patch NewControl during your call to
  1710. GetNewDialog, and in the patch set the appropriate bit in the variationCode
  1711. before calling the old trap address. It's a wee bit ugly but works fine.
  1712.  
  1713. Another solution is simply not using the Dialog Manager. This is really
  1714. feasible only if you have a framework (MacApp, TCL, PowerPlant...) that will
  1715. let you set up complex windows easily. I did this approach for the
  1716. AppleScript Script Editor, with a hand-rolled framework. It works great, but
  1717. the overhead is a bit high for a small app.
  1718.  
  1719. --Jens Alfke
  1720.   jens_alfke@powertalk              Rebel girl, rebel girl,
  1721.             .apple.com              Rebel girl you are the queen of my world
  1722.  
  1723. +++++++++++++++++++++++++++
  1724.  
  1725. >From tomcat@email.teaser.com ( Florent Pillet)
  1726. Date: Thu, 7 Apr 1994 13:10:40 GMT
  1727. Organization: France-Teaser
  1728.  
  1729. References: <askwersk-010494155542@el-2.media.mit.edu>
  1730.  
  1731. askwersk@athena.mit.edu (Adam Skwersky) writes:
  1732. > In article <2neija$i2@nntp.hut.fi>, heilei@colossus.cs.hut.fi (Heikki
  1733. > Leinonen) wrote:
  1734. > >. If I created the controls myself, I could
  1735. > >   add the useWFont constant to controls' definition values. But
  1736. > >   making the layout with ResEdit is SOOOOO easy...
  1737. > > 
  1738. > >   Anyone have any bright ideas on this one? 
  1739. > I have had a similar problem. I was trying to use the custom Connection
  1740. > Manager
  1741. > Setup routines that add DITL's to your dialog and you use the DITL's to
  1742. > setup up a certain tool. The items are all SUPPOSED to be in geneva 9, and
  1743. > when you call the toolbox command CMChoose() thats what you get. However
  1744. > if I were to add the DITL's to my OWN dialog, they all come out in
  1745. > Chicago 12. I thought about trying to go through each dialog item and
  1746. > changing its procID to procID+useWFont, but I could not even find the
  1747. > procID field in the ControlHandle record! I'm really lost with this as
  1748. > well,
  1749. > and I do not think it is a FAQ. Do any Mac gurus out there know how to go
  1750. > through a bunch of controls (dialog items) and change their fonts and
  1751. > sizes?
  1752. > Adam Skwersky
  1753. > askwersk@mit.edu
  1754. > adams@media.mit.edu
  1755.  
  1756.  I have EXACTLY the same problem and I'm managing to setup my custom
  1757.  connection manager setup dialog box.
  1758.  
  1759.  Well, it mostly works. I followed the example given in "IM: CTB", but
  1760.  before doing any update in the CTB part of the dialog box, or before
  1761.  calling any CTB function, I call a function of mine, which uses the
  1762.  Script Manager to set the current font attributes. It works for
  1763.  the control texts but not for the static or edit texts. The only
  1764.  way I've found to set the static & edit text font is to modify
  1765.  the SysFontFam & SysFontSiz low-memory variables but this is dirty
  1766.  and it also affects the menu bar (sometimes) and other window's title
  1767.  bar (always).
  1768.  
  1769.  Here is the function I use to set everything up before calling the
  1770.  connection manager:
  1771.  
  1772. static void SetCTBToolEnv(dialogInfoPtr infoP,DialogPtr theDialog)
  1773. {
  1774.   short script;
  1775.   unsigned long fnt;
  1776.  
  1777.   UseResFile(0);
  1778.   SetPort((GrafPtr)theDialog);
  1779.  
  1780.   fnt = ((long)geneva << 16L) | 9L;
  1781.   script = FontScript();
  1782.  
  1783.   SetScriptVariable(script,smScriptMonoFondSize,fnt);
  1784.   SetScriptVariable(script,smScriptPrefFondSize,fnt);
  1785.   SetScriptVariable(script,smScriptSmallFondSize,fnt);
  1786.   SetScriptVariable(script,smScriptSysFondSize,fnt);
  1787.   SetScriptVariable(script,smScriptAppFondSize,fnt);
  1788.  
  1789.   TextFont(geneva);
  1790.   TextSize(9);
  1791. }
  1792.  
  1793.  
  1794.  
  1795.   Well, this is a hack but it works. I still have to find how setup the
  1796.   Edit & Static Text font so it affects only my window.
  1797.  
  1798.   Anyway, those f****g bastards at Apple who have designed the CTB and
  1799.   implemented it should be thrown on a desert island. I can't imagine how
  1800.   they could do such a bad design and I don't understand why they decided
  1801.   to document only the easiest-to-use parts of their tools.
  1802.  
  1803.   Apple often makes beautiful software. This one was an exception. Ugly.
  1804.  
  1805.  
  1806.   Hope the code helps,
  1807.   Florent.
  1808.  
  1809. --
  1810.  
  1811.   Florent Pillet, freelance programmer.             ____/|
  1812.   Location: Paris, France.                          \ o O|
  1813.     E-Mail: tomcat@email.teaser.com                 =(_T_)=
  1814.                                                        U
  1815.  
  1816. +++++++++++++++++++++++++++
  1817.  
  1818. >From saseew@router.unx.sas.com (Ed Walker)
  1819. Date: Thu, 7 Apr 1994 13:31:45 GMT
  1820. Organization: SAS Institute Inc.
  1821.  
  1822.  
  1823. In article <1994Apr7.011549.21208@gallant.apple.com>, Jens Alfke <jens_alfke@powertalk.apple.com> writes:
  1824. >Heikki Leinonen, heilei@colossus.cs.hut.fi writes:
  1825. >>   is there a SIMPLE way to make *all* the texts
  1826. >>   (meaning static and edit texts, button and check box titles etc.)
  1827. >>   in my dialog something else than Chicago 12?
  1828. >
  1829.  
  1830. stuff deleted
  1831.  
  1832. >
  1833. >--Jens Alfke
  1834. >  jens_alfke@powertalk              Rebel girl, rebel girl,
  1835. >            .apple.com              Rebel girl you are the queen of my world
  1836.  
  1837. One thing that works for me is SetDAFont(n) before opening the dialog.
  1838. This only changes the font for static and edit text. Once your
  1839. dialog is open you can use SetDAFont(0) to restore the system font
  1840. for your other dialogs (like alerts) and it won't affect the opened
  1841. dialogs.
  1842.  
  1843. Ed                                               >'<                   
  1844.                                                 (o o)                  
  1845. +---------------------------------------------o0o-U-o0o---------------+
  1846. | EdWalker@aol.com    (home)     | It is impossible to make anything  |
  1847. | saseew@sas.mvs.com  (work)     | foolproof; fools are so ingenious. |
  1848. +---------------------------------------------oo0---0oo---------------+
  1849.  
  1850. +++++++++++++++++++++++++++
  1851.  
  1852. >From d88-jwa@hemul.nada.kth.se (Jon Wdtte)
  1853. Date: 7 Apr 1994 14:30:59 GMT
  1854. Organization: The Royal Institute of Technology
  1855.  
  1856. In <i7e3f.n3.t1ad56e60@email.teaser.com> tomcat@email.teaser.com ( Florent Pillet) writes:
  1857.  
  1858. >  Anyway, those f****g bastards at Apple who have designed the CTB and
  1859. >  implemented it should be thrown on a desert island. I can't imagine how
  1860. >  they could do such a bad design and I don't understand why they decided
  1861. >  to document only the easiest-to-use parts of their tools.
  1862.  
  1863. That obviously stands for your opinion, but I feel this is a rather
  1864. wonderful part of system software, and it solves a whole class of
  1865. problems which ANY other operating system simply ignores (at worst)
  1866. or doesn't really have any coherent support for (at best)
  1867.  
  1868. You are of course welcome to write your own code, but using such
  1869. language about Apple engineers will not improve your standing in
  1870. this newsgroup.
  1871.  
  1872. PS: There has been rumors about the CTB dying, but when I checked
  1873. with DTS, it seems those rumors are false. The CTB will not disappear
  1874. from the OS for the forseeable future, and it will "at some point in
  1875. time" "probably" become native; it's just no sense in doing so now,
  1876. since there are no native tools and the context switches would just
  1877. kill it.
  1878.  
  1879. -- 
  1880.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  1881.   "After I first used the Mac, I had a dream in which I would walk up to
  1882.    people, touch them, and they'd turn black. Then I could talk to them."
  1883.                      -- Anon
  1884.  
  1885. ---------------------------
  1886.  
  1887. >From hagst3+@pitt.edu (Herschel A Gelman)
  1888. Subject: Removing PowerPC code from a fat binary
  1889. Date: 1 Apr 94 22:15:40 GMT
  1890. Organization: University of Pittsburgh
  1891.  
  1892. Well, the subject line says most of it.  Is there an easy way to do this?  I'd
  1893. rather have the 680x0 code only, rather than waste already minimal hard drive
  1894. space.
  1895.  
  1896. I grabbed the fat version of JPEGView, and it seems like the 601 code is all in
  1897. the data fork.  Weird.  An older version I found had nothing in the data fork,
  1898. so it seems safe to just cut that out.  Which I haven't gotten around to doing
  1899. yet.  (I assume I'd have to change it to type text, then go in with a word
  1900. processor and select-all and delete -- is there an easier way??)
  1901.  
  1902. Is there anything in the resource fork?  How would a program distinguish
  1903. between data and PowerPC code, and how would I distinguish if I'm trying to
  1904. shorten the program like this?
  1905.  
  1906. I'd prefer E-mail responses...  gracias..
  1907.  
  1908.  
  1909. -- 
  1910. - -------------- Herschel Gelman ----------- hagst3+@pitt.edu -----------------
  1911.  
  1912. +++++++++++++++++++++++++++
  1913.  
  1914. >From d88-jwa@mumrik.nada.kth.se (Jon Wdtte)
  1915. Date: 2 Apr 1994 08:01:04 GMT
  1916. Organization: The Royal Institute of Technology
  1917.  
  1918. In <18996@blue.cis.pitt.edu> hagst3+@pitt.edu (Herschel A Gelman) writes:
  1919.  
  1920. >Well, the subject line says most of it.  Is there an easy way to do this?  I'd
  1921. >rather have the 680x0 code only, rather than waste already minimal hard drive
  1922. >space.
  1923.  
  1924. 1) Set the data fork length to 0 bytes
  1925. 2) Remove the cfrg resource
  1926.  
  1927. Done.
  1928. -- 
  1929.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  1930.   "It was, in fact, cool as all get-out.  Fortunately it was a little
  1931.    too late (historically speaking) to be groovy."
  1932.                      -- Dennis Pelton
  1933.  
  1934. +++++++++++++++++++++++++++
  1935.  
  1936. >From jackl@netcom.com (Jack Littleton)
  1937. Date: Mon, 4 Apr 1994 15:31:35 GMT
  1938. Organization: Law Offices of Buttafuoco, Bobbit and Harding
  1939.  
  1940. Jon Wdtte (d88-jwa@mumrik.nada.kth.se) wrote:
  1941. : 1) Set the data fork length to 0 bytes
  1942. : 2) Remove the cfrg resource
  1943.  
  1944. : Done.
  1945.  
  1946. To be really safe, I'd check the offset field of the cfrg resource before
  1947. doing this.  It is still possible, although not recommended, to store data
  1948. in the data fork of a fat binary.  The offset field in the cfrg tells the
  1949. CFM where the actual code starts (or other code fragments start).  If the
  1950. offset is zero, as it is for most apps I've seen, go ahead and zap the
  1951. data fork.
  1952. -- 
  1953. Jack Littleton                                               jackl@netcom.com
  1954. PowerPC and/or 68k Debugger Engineer                      Apple Computer, Inc.
  1955. (WARNING: Above title can change suddenly and without warning)
  1956.  
  1957.      ### This, and all other posts generated by myself, are in no ###
  1958.      ### way meant to be an official view of Apple Computer, Inc. ###
  1959.  
  1960. +++++++++++++++++++++++++++
  1961.  
  1962. >From jwbaxter@olympus.net (John W. Baxter)
  1963. Date: Mon, 04 Apr 1994 11:02:42 -0700
  1964. Organization: Internet for the Olympic Peninsula
  1965.  
  1966. In article <jacklCnqr4p.885@netcom.com>, jackl@netcom.com (Jack Littleton)
  1967. wrote:
  1968.  
  1969. > Jon Wtte (d88-jwa@mumrik.nada.kth.se) wrote:
  1970. > : 1) Set the data fork length to 0 bytes
  1971. > : 2) Remove the cfrg resource
  1972. > : Done.
  1973. > To be really safe, I'd check the offset field of the cfrg resource before
  1974. > doing this.  It is still possible, although not recommended, to store data
  1975. > in the data fork of a fat binary.  The offset field in the cfrg tells the
  1976. > CFM where the actual code starts (or other code fragments start).  If the
  1977. > offset is zero, as it is for most apps I've seen, go ahead and zap the
  1978. > data fork.
  1979.  
  1980. If you're going to go to the trouble of checking the offset field, also
  1981. check the length field...the fragment can be at offset zero with other
  1982. stuff after it.  If the length field is zero (kWholeFork, or some name like
  1983. that...fancy for 0), THEN the data fork is all [one] application fragment.
  1984.  
  1985. Or...try it "blind" and see whether the application objects.  [It may even
  1986. be worth it with JPEGView (the app in the original question):  almost 300K
  1987. out of the about 775K file is data fork.]
  1988. -- 
  1989. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1990.    jwbaxter@pt.olympus.net
  1991.  
  1992. +++++++++++++++++++++++++++
  1993.  
  1994. >From macguru@halcyon.com. (Allan Foster)
  1995. Date: 4 Apr 1994 21:26:40 GMT
  1996. Organization: Guru Inc
  1997.  
  1998. In article <jwbaxter-040494110242@ptpm004.olympus.net>
  1999. jwbaxter@olympus.net (John W. Baxter) writes:
  2000.  
  2001. > In article <jacklCnqr4p.885@netcom.com>, jackl@netcom.com (Jack Littleton)
  2002. > wrote:
  2003. > > Jon Wtte (d88-jwa@mumrik.nada.kth.se) wrote:
  2004. > > : 1) Set the data fork length to 0 bytes
  2005. > > : 2) Remove the cfrg resource
  2006. > > 
  2007. > > : Done.
  2008. > > 
  2009. > > To be really safe, I'd check the offset field of the cfrg resource before
  2010. > > doing this.  It is still possible, although not recommended, to store data
  2011. > > in the data fork of a fat binary.  The offset field in the cfrg tells the
  2012. > > CFM where the actual code starts (or other code fragments start).  If the
  2013. > > offset is zero, as it is for most apps I've seen, go ahead and zap the
  2014. > > data fork.
  2015. > If you're going to go to the trouble of checking the offset field, also
  2016. > check the length field...the fragment can be at offset zero with other
  2017. > stuff after it.  If the length field is zero (kWholeFork, or some name like
  2018. > that...fancy for 0), THEN the data fork is all [one] application fragment.
  2019. > Or...try it "blind" and see whether the application objects.  [It may even
  2020. > be worth it with JPEGView (the app in the original question):  almost 300K
  2021. > out of the about 775K file is data fork.]
  2022. > -- 
  2023.  
  2024. If you REALLY want to do the right thing,  then you may want to look to
  2025. see if there are any other cfrg resources in the resource fork.  Since
  2026. there is nothing stopping anyone from having MULTIPLE containers in the
  2027. data fork, you may have to update the other cfrg resources if you
  2028. delete stuff.....
  2029.  
  2030. And nothing says it has to start at 0 either!
  2031. - --------------------------------------------------------
  2032. I am responsible for what I say and do. -- Allan Foster --
  2033.  
  2034. +++++++++++++++++++++++++++
  2035.  
  2036. >From troy@i-link.com (Troy Gaul)
  2037. Date: 4 Apr 1994 23:43:30 -0500
  2038. Organization: I-Link, Ltd., Des Moines, IA, USA - 515/255-2754
  2039.  
  2040. In article <2nq0mg$t31@nwfocus.wa.com>,
  2041. Allan Foster <macguru@halcyon.com.> wrote:
  2042. >In article <jwbaxter-040494110242@ptpm004.olympus.net>
  2043. >jwbaxter@olympus.net (John W. Baxter) writes:
  2044. >
  2045. >> In article <jacklCnqr4p.885@netcom.com>, jackl@netcom.com (Jack Littleton)
  2046. >> wrote:
  2047. >> 
  2048. >> > Jon Wtte (d88-jwa@mumrik.nada.kth.se) wrote:
  2049. >> > : 1) Set the data fork length to 0 bytes
  2050. >> > : 2) Remove the cfrg resource
  2051. >> > 
  2052. >> > : Done.
  2053. >> > 
  2054. >> > To be really safe, I'd check the offset field of the cfrg resource before
  2055. >> > doing this.  It is still possible, although not recommended, to store data
  2056. >> > in the data fork of a fat binary.  The offset field in the cfrg tells the
  2057. >> > CFM where the actual code starts (or other code fragments start).  If the
  2058. >> > offset is zero, as it is for most apps I've seen, go ahead and zap the
  2059. >> > data fork.
  2060. >> 
  2061. >> If you're going to go to the trouble of checking the offset field, also
  2062. >> check the length field...the fragment can be at offset zero with other
  2063. >> stuff after it.  If the length field is zero (kWholeFork, or some name like
  2064. >> that...fancy for 0), THEN the data fork is all [one] application fragment.
  2065. >> 
  2066. >> Or...try it "blind" and see whether the application objects.  [It may even
  2067. >> be worth it with JPEGView (the app in the original question):  almost 300K
  2068. >> out of the about 775K file is data fork.]
  2069. >> -- 
  2070. >
  2071. >If you REALLY want to do the right thing,  then you may want to look to
  2072. >see if there are any other cfrg resources in the resource fork.  Since
  2073. >there is nothing stopping anyone from having MULTIPLE containers in the
  2074. >data fork, you may have to update the other cfrg resources if you
  2075. >delete stuff.....
  2076.  
  2077. There shouldn't be more than one 'cfrg' resource.  Only the one with ID 0
  2078. is looked at, but it can describe multiple code fragments.
  2079.  
  2080. You would also want to check the code's type, as it might not be for the
  2081. PowerPC ('pwpc').  It could (in the future) be for the 68K or
  2082. theoretically some other processor.
  2083.  
  2084. Theoretically, there can be data after code, multiple codes (multiple
  2085. fragments for one processor or fragments for different processors -- or 
  2086. both), and there could even be multiple datas interspersed between codes.
  2087.  
  2088. _troy
  2089. -- 
  2090. //////// //////   Troy Gaul                            t-gaul@i-link.com   //
  2091.   //    //       I-Link, Ltd.                                             //
  2092.  //    //  //   "Iungo ergo sum." (I-Link, therefore I am.)              //
  2093. //    ////// __________________________________________________________ //
  2094.  
  2095. +++++++++++++++++++++++++++
  2096.  
  2097. >From johnson@wrs.com (David Johnson)
  2098. Date: Fri, 8 Apr 1994 01:35:09 GMT
  2099. Organization: Wind River Systems, Inc.
  2100.  
  2101. jackl@netcom.com (Jack Littleton) writes:
  2102.  
  2103. >Jon Wdtte (d88-jwa@mumrik.nada.kth.se) wrote:
  2104. >: 1) Set the data fork length to 0 bytes
  2105. >: 2) Remove the cfrg resource
  2106.  
  2107. >: Done.
  2108.  
  2109. >To be really safe, I'd check the offset field of the cfrg resource before
  2110. >doing this.  It is still possible, although not recommended, to store data
  2111. >in the data fork of a fat binary.  The offset field in the cfrg tells the
  2112. >CFM where the actual code starts (or other code fragments start).  If the
  2113. >offset is zero, as it is for most apps I've seen, go ahead and zap the
  2114. >data fork.
  2115.  
  2116. If you want to just shit-can the data fork and see if the app runs, use
  2117. one of the the apps made for munging the registration info that a lot
  2118. of apps store in the data fork.  A little more elegent than using a
  2119. word-processor.
  2120.  
  2121. Let's see what we have here...
  2122.  
  2123. /folk/johnson/Misc/Umich/mac.archive.umich.edu.gz    %71.2
  2124. /mac/util/diskfile/anonymity1.2.cpt.hqx
  2125.   34    12/20/92    BinHex4.0,Compact1.34
  2126.  
  2127.    Remove the personalization info from programs (like Word and Excel)
  2128.    that store the info (and ONLY the info) in the data fork.
  2129.  
  2130.  
  2131. Yup, that otta do it :-)
  2132.  
  2133. --DAVE (johnson@wrs.com)
  2134.  
  2135. "And now, a man who faces his destiny at FULL THROTTLE...  Its David Letterman!"
  2136.  
  2137.                                    (c)1993 CBS
  2138.  
  2139. ---------------------------
  2140.  
  2141. >From Vik_Rubenfeld@lamg.com (Vik Rubenfeld)
  2142. Subject: Roman Numerals
  2143. Date: 05 Apr 1994 00:21:15 -0000
  2144. Organization: (none)
  2145.  
  2146. Does anybody have an algorithm for translating an integer into a string that
  2147. contains its Roman Numeral equivalent? Thanks in advance.
  2148.  
  2149. +++++++++++++++++++++++++++
  2150.  
  2151. >From Vik_Rubenfeld@lamg.com (Vik Rubenfeld)
  2152. Date: 06 Apr 1994 10:20:10 -0000
  2153. Organization: (none)
  2154.  
  2155. Thanks for the extremely cool algorithm.
  2156.  
  2157. +++++++++++++++++++++++++++
  2158.  
  2159. >From Vik_Rubenfeld@lamg.com (Vik Rubenfeld)
  2160. Date: 07 Apr 1994 11:32:15 -0000
  2161. Organization: (none)
  2162.  
  2163.  
  2164. Thanks for your excellent procedure, ArabicToRoman. It was also a good
  2165. excercise for me to use in becoming more familiar with C, because I
  2166. translated it from C to Pascal. In case you'd like to see it, and in case
  2167. others would like a Pascal version, here's what it looks like in Pascal.
  2168.  
  2169.  
  2170. procedure ArabicToRoman (arab: integer;
  2171.        var Rom: DecStr);
  2172.   const
  2173.    nFives = 3;
  2174.    nOnes = 4;
  2175.  
  2176.   var
  2177.    reverse: integer;{ stores digits in reverse order (6533 -> 3356) }
  2178.    mag: integer;{ magnitude of the arabic number (6533 -> 3   ) }
  2179.    digit: integer;{ current digit being processed                 }
  2180.  
  2181.    Fives, Ones: DecStr;
  2182.  begin
  2183.   reverse := 0;
  2184.   mag := -1;
  2185.   Rom := '';
  2186.  
  2187.   Fives := 'vld';
  2188.   Ones := 'ixcm';
  2189.  
  2190.   while (arab > 0) do
  2191.    begin
  2192.     reverse := reverse * 10;
  2193.     reverse := reverse + (arab mod 10);
  2194.     arab := arab div 10;
  2195.     mag := mag + 1;
  2196.    end;
  2197.  
  2198.   while reverse > 0 do
  2199.    begin
  2200.     digit := reverse mod 10;
  2201.     reverse := reverse div 10;
  2202.  
  2203.     if (((mag = nFives) & (digit > 3)) | ((mag = nOnes) & (digit <> 5)) |
  2204. ((digit = 9) & (mag = nOnes - 1))) then
  2205.      begin
  2206.       Rom := 'Cannot Convert';
  2207.       exit(ArabicToRoman);
  2208.      end;
  2209.  
  2210.     case digit of
  2211.      3: 
  2212.       begin
  2213.        rom := concat(rom, ones[mag + 1]);
  2214.        rom := concat(rom, ones[mag + 1]);
  2215.        rom := concat(rom, ones[mag + 1]);
  2216.       end;
  2217.      2: 
  2218.       begin
  2219.        rom := concat(rom, ones[mag + 1]);
  2220.        rom := concat(rom, ones[mag + 1]);
  2221.       end;
  2222.      1: 
  2223.       rom := concat(rom, ones[mag + 1]);
  2224.  
  2225.      4: 
  2226.       begin
  2227.        rom := concat(rom, ones[mag + 1]);
  2228.        rom := concat(rom, fives[mag + 1]);
  2229.       end;
  2230.  
  2231.      5: 
  2232.       rom := concat(rom, fives[mag + 1]);
  2233.  
  2234.      6: 
  2235.       begin
  2236.        rom := concat(rom, fives[mag + 1]);
  2237.        rom := concat(rom, ones[mag + 1]);
  2238.       end;
  2239.  
  2240.      7: 
  2241.       begin
  2242.        rom := concat(rom, fives[mag + 1]);
  2243.        rom := concat(rom, ones[mag + 1]);
  2244.        rom := concat(rom, ones[mag + 1]);
  2245.       end;
  2246.  
  2247.      8: 
  2248.       begin
  2249.        rom := concat(rom, fives[mag + 1]);
  2250.        rom := concat(rom, ones[mag + 1]);
  2251.        rom := concat(rom, ones[mag + 1]);
  2252.        rom := concat(rom, ones[mag + 1]);
  2253.       end;
  2254.  
  2255.      9: 
  2256.       begin
  2257.        rom := concat(rom, ones[mag + 1]);
  2258.        rom := concat(rom, ones[mag + 2]);
  2259.       end;
  2260.  
  2261.      otherwise
  2262.       ;
  2263.     end; {case}
  2264.     mag := mag - 1;
  2265.    end; {while}
  2266.  end;
  2267.  
  2268.  
  2269.  
  2270.  
  2271. +++++++++++++++++++++++++++
  2272.  
  2273. >From Vik_Rubenfeld@lamg.com (Vik Rubenfeld)
  2274. Date: 08 Apr 1994 21:51:07 -0000
  2275. Organization: (none)
  2276.  
  2277. CMG> Hi there! I have some Pascal code that I wrote for a program that
  2278. CMG> converts Decimal, hexadecimal, etc. to Roman Numerals and vice
  2279. CMG> versa... I might be able to dig it up : ) 
  2280. CMG> 
  2281. CMG> What kind of program are you writing?
  2282.  
  2283. Thanks! Sure, I'd like to see it. I've adapted a C routine provided by Mike
  2284. Mayer, and it's working fine, but the hex part of your code might be neat to
  2285. see. 
  2286.  
  2287. It's a program that tabulates Market Research data. It's the basis of a
  2288. business I operate. I wanted to use Roman Numerals for the page numbers in
  2289. the table of contents.
  2290.  
  2291. ---------------------------
  2292.  
  2293. >From armitage@marksmac.demon.co.uk (Mark Armitage)
  2294. Subject: SCSI Drivers
  2295. Date: Thu, 7 Apr 1994 12:54:12 GMT
  2296. Organization: Poor,  but trying...
  2297.  
  2298. Help,
  2299.  
  2300. I have a non-apple SCSI drive which requires a SCSI START command to be
  2301. sent to it!  (Apparently the drive doesn't acually start spinning until
  2302. this command is received).
  2303.  
  2304. Can anyone point me in the direction of a utility/init or piece of code
  2305. that can perform this function?
  2306.  
  2307. Thanks,
  2308.  
  2309. Mark.
  2310.  
  2311. armitage@marksmac.demon.co.uk
  2312.  
  2313. +++++++++++++++++++++++++++
  2314.  
  2315. >From lankton@spot.Colorado.EDU (LANKTON MARK)
  2316. Date: Fri, 8 Apr 1994 13:47:55 GMT
  2317. Organization: University of Colorado, Boulder
  2318.  
  2319. armitage@marksmac.demon.co.uk (Mark Armitage) writes:
  2320.  
  2321. >Help,
  2322.  
  2323. >I have a non-apple SCSI drive which requires a SCSI START command to be
  2324. >sent to it!  (Apparently the drive doesn't acually start spinning until
  2325. >this command is received).
  2326.  
  2327. >Can anyone point me in the direction of a utility/init or piece of code
  2328. >that can perform this function?
  2329.  
  2330. >Thanks,
  2331.  
  2332. >Mark.
  2333.  
  2334. >armitage@marksmac.demon.co.uk
  2335.  
  2336. Try this:
  2337.  
  2338.  
  2339. #define     kStartStopUnitCmd    0x1B
  2340. #define     kStartCode            0x01
  2341. #define     kStopCode            0x00
  2342. SpinUp(short targetID)
  2343. {
  2344.     short             theResult;
  2345.     unsigned char    theCommand[6];
  2346.     sensePage        returnedSense;    
  2347.     short            numTries = 0;
  2348.     Boolean            gotBus = false;
  2349.     int                waitTime = 100;    /*or so...*/
  2350.     short            returnedStatus = 0;
  2351.     short            returnedMessage = 0;
  2352.         
  2353.     
  2354.     theCommand[0] = kStartStopUnitCmd;
  2355.     theCommand[1] = 0x01;    /*Don't wait for reply on command */
  2356.     theCommand[2] = 0;
  2357.     theCommand[3] = 0;
  2358.     theCommand[4] = kStartCode;
  2359.     theCommand[5] = 0;
  2360.     
  2361.     do
  2362.         {
  2363.         numTries++;
  2364.         theResult = SCSIGet();
  2365.         if(theResult == noErr)
  2366.             {
  2367.             theResult = SCSISelect(targetID);
  2368.             if(theResult == noErr)
  2369.                 gotBus = true;
  2370.             
  2371.             }            
  2372.         }    
  2373.         while((numTries <= kMaxSelectTries) && (!gotBus));
  2374.         
  2375.     if((numTries >= kMaxSelectTries) || !gotBus)
  2376.         {
  2377.         printf("SCSI device selection failed on ID = %d",targetID);
  2378.         return;
  2379.         }
  2380.         
  2381.     if(gotBus)
  2382.         {
  2383.         theResult = SCSICmd((char *)theCommand,6);
  2384.         theResult = SCSIComplete(&returnedStatus,&returnedMessage,waitTime);
  2385.         }
  2386.         
  2387.     /*Check returnedStatus for errors
  2388.  
  2389. }    
  2390.  
  2391. Mark Lankton (lankton@spot.colorado.edu)
  2392. Laboratory for Atmospheric and Space Physics
  2393. University of Colorado
  2394.  
  2395. ---------------------------
  2396.  
  2397. End of C.S.M.P. Digest
  2398. **********************
  2399.  
  2400.