Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!oliveb!pyramid!voder!apple!han From: han@apple.UUCP (Byron Han) Newsgroups: comp.sys.mac Subject: Re: ... programming the Mac difficult? [LONG] Message-ID: <978@apple.UUCP> Date: Wed, 10-Jun-87 12:13:52 EDT Article-I.D.: apple.978 Posted: Wed Jun 10 12:13:52 1987 Date-Received: Sat, 20-Jun-87 04:12:44 EDT References: <869@apple.UUCP> <1499@midas.TEK.COM> Organization: Apple Computer, Inc., Cupertino, USA Lines: 89 Sorry about quoting the posting [since I've been guilty of the dreaded over-quote syndrome :-) ] And sorry about the length of the posting, too. In article <1499@midas.TEK.COM>, herbw@midas.TEK.COM (Herb Weiner) writes: > -------- > > In summary, I believe that there are a few common operations (... every > application developer needs to deal with) that are not handled completely > by the toolbox routines: > > 1. ...to put up a dialog with the default button highlighted. > ... I must provide my own code to highlight the button. I normally keep around a small library of routines that I call often. I'll post them in a following posting. This is actually very trivial. Create a UserItem in the Dialog with the same ItemRect as the default button, and use SetDItem to set it to have a user item proc of a outline drawing routine. > (Clue that this is difficult: so many applications simply neglect > to highlight the default button.) This is actually a sign of laziness. > > 2. I want to do a CopyBits of more than 3K bytes. I must write a loop to do > this. You could set your application stack size to be larger at startup. > > 3. My desktop (file) has seen countless failed attempts (by public domain and > shareware programs) to create custom icons for applications and documents. I guess this is tough to answer. Once you get the hang of it, it isn't too bad. > > 5. ... I'll just say that doing *anything* with HFS is difficult, Amen. > ... and creating/playing back pictures (OpenPicture/DrawPicture) This may help. VAR thePict : PicHandle; PictRect : Rect; saneRect : Rect; BEGIN { standard init stuff like InitGraf, etc etc etc} SetRect(saneRect,0,0,screenBits.bounds.right,screenBits.bounds.bottom); SetRect(PictRect, 100, 100, 200, 200); thePict = OpenPicture(PictRect); MoveTo(0, 0); LineTo(10, 10); ... ClosePicture; {set up a normal clip region so DrawPicture doesn't ack} ClipRect(saneRect); DrawPicture(thePict, PictRect); > > I recognize that MacApp *might* solve some of these criticisms, but MacApp is > not a solution for everyone. That's right. There are no magic panaceas. > ...I would like to point out that I would not have taken the time to offer > these constructive criticisms if I did not like my Mac. No - you should LOVE your Mac. ;-) > -- Herb Weiner (UUCP: !tektronix!midas!herbw) > (AppleLink: D0521) ===================================================================== Byron Han | UUCP: {sun,voder,nsc,mtxinu,dual}!apple!han Apple Computer, Inc. | CSNET: han@apple.csnet 20525 Mariani Ave, | ATTNet: 408-973-6450 Cupertino, CA 95014 | GENIE: BYRONHAN APPLELINK: HAN1 MS 27Y | CSERVE: 72167,1664 ===================================================================== All opinions and statements do not necessarily represent those of my employer, Apple Computer Inc. =====================================================================