Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!adobe!hawley From: hawley@adobe.COM (Steve Hawley) Newsgroups: comp.sys.mac.programmer Subject: Re: Drawing direct to a dialog window... Message-ID: <15301@adobe.UUCP> Date: 16 May 91 16:40:09 GMT References: <1991May15.131300.9898@umiami.ir.miami.edu> Reply-To: hawley@adobe.UUCP (Steve Hawley) Organization: Adobe Systems Incorporated, Mountain View Lines: 43 In article <1991May15.131300.9898@umiami.ir.miami.edu> 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 can think of no reason why it would not be safe to draw into a dialog window as if it were a window. I would not recommend it. Think about the roots of the Dialog Manager, it is a package designed to group a small set of controls into fairly simple data structure and provide a simple mechanism for bringing up the window that will be used only for a short time, generally to present a message or query the user. This is ideal for things like confirmation boxes ('Do you want to save changes to "Threatening Letter to Grandma"?'), simple font selection, or search/replace boxes. The idea is that you as the programmer accept the fact that the Dialog Box need not worry about absolutely every detail that you handle in your main event loop, and as such, you relinquish event handling to the Dialog Box for the transitory time it will be exciting the phsphors on your screen. When you start hacking your searc/replace dialong to have an option to also provide a keen interface to an online dictionary to define the word you're looking for, or perhaps first look it up in a synonymicon (that's another word for thesaurus, by the way) and give you a pop up control that has a custom doo-dad to let you select from the list of synonyms and do poke-and-drag selection of an appropriate context-sensitive boolean search criteria, you should begin to wonder if you should be using a Dialog Box. Really, the only thing a Dialog Box does is tie together CNTL and WIND resources for you, and do some event handling. When your Dialog Box starts getting out of hand, you should do this yourself. >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? From your description, I think you're better off using a WIND, a set of CNTL's and your own event loop. Steve Hawley hawley@adobe.com -- "Did you know that a cow was *MURDERED* to make that jacket?" "Yes. I didn't think there were any witnesses, so I guess I'll have to kill you too." -Jake Johansen