Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!stevec From: stevec@Apple.COM (Steve Christensen) Newsgroups: comp.sys.mac.programmer Subject: Re: Drawing direct to a dialog window... Message-ID: <52984@apple.Apple.COM> Date: 17 May 91 02:46:33 GMT References: <1991May15.131300.9898@umiami.ir.miami.edu> Organization: Apple Computer Inc., Cupertino, CA Lines: 30 dweisman@umiami.ir.miami.edu (Ordinary Man) writes: > > Is it safe/recommended to draw to a dialog window as if it was a window? >I mean I have no userItems in my dialog; I just set the port to the dialog >after I create it and draw all sorts of things in it as if it was a window. No >problems. I even utilize the ModalDialog's filter function to do some realtime >animation in the dialog. No problems still. Is this bad? Also then, what are >userItem's good for then? Why not just draw everything straight to the port? >(naive question, I know, but just want to get everything out in the open). A dialog window is basically a window, so you can draw into it the same as any other window. The only difference is that because it has an associated item list, various things (like text, pictures, icons, etc.), are automatically drawn in the window for you without your application having to know anything about them. This is very handy for translation into other languages, and for making little changes to the look of a dialog without having to re-write a bunch of code. So why bother with all the "hassle" of userItems, etc., to specify where stuff is drawn? Well, if the dialog needs to be rearranged for, say, translation to another language, you can quickly move the items around with ResEdit instead of having to make changes to your code. Just use the item's bounding rectangle and scale your drawing if possible and/or appropriate... steve -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Steve Christensen Never hit a man with glasses. stevec@apple.com Hit him with a baseball bat.