topix@gpu.utcs.utoronto.ca (R. Munroe) (06/29/90)
I am somewhat new to mac programming and, although I have been reading just about everything on mac programming ever written, I am left with numerous questions. Two, however, are important at the moment: 1. What is the best way to implement an animation in my application's "About Box"? For example, I may want to animate a light bulb turning on and off when the About Box is active. What is the best way to do this? 2. I can find the amount of disk space remaining on the default volume by calling GetVInfo. However, I can't figure out how to get the amount of remaining RAM (such as in the Finder slider in About The Finder). I thought FreeMem would return that value but it only returns the amount of free space in the current heap zone. Any and all help is appreciated. Thanks Bob Munroe topix@utcs.utoronto.ca
hawley@adobe.COM (Steve Hawley) (06/29/90)
In article <1990Jun29.030522.7791@gpu.utcs.utoronto.ca> topix@gpu.utcs.utoronto.ca (R. Munroe) writes: >I am somewhat new to mac programming and, although I have been reading just >about everything on mac programming ever written, I am left with numerous >questions. Two, however, are important at the moment: > > 1. What is the best way to implement an animation in my application's > "About Box"? For example, I may want to animate a light bulb > turning on and off when the About Box is active. What is the best > way to do this? Phew! I'm glad you asked this. About Box animation is THE MOST important part of you Macintosh application. This space is your chance to really show off as a programmer, since your application itself certainly does not allow such an opportunity. In order to correctlt do an About Box, use the following guidelines: 1) The code and data used should take up AT LEAST 50% of the app 2) It should do REALLY strange things if you have color 3) It should have hidden "hot spots" to mouse on 4) Holding down various keys in various combinations and typing obscure phrases (like "Clarus the dogcow says moof!") should do even more exciting things 4) Make it REALLY dull on any machine "under" a Mac SE, just to annoy them and force them to upgrade, upgrade, upgrade! All seriousness aside: The easiest way to do simple animations is to have one or more PICT's in your resource fork that read in with a call to GetPicture(). Usually I convert them to an offscreen BitMap for performance, and stamp them into the window in succession. You can make your PICTs by drawing them in most any paint program, cutting the image to the clipboard and pasting it into the resource fork of your app with ResEdit. The last app I did at my old job featured an about box with a full color PICT drawn in Studio/8 and pasted into Resedit. I also made a B&W vewsion for "the rest of us". These were both removed because the color PICT was 65K and the rest of the app was about 55K (oops). So I made a nice looking b&w picture and a set of scrolling credits (with the names in a STR# resource so any conniving hacker could put anything in there). Steve Hawley hawley@adobe.com -- "A blow on the head is... ...worth two in the bush." -Basil Fawlty