Newsgroups: comp.sys.mac.programmer Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!caen!sdd.hp.com!wuarchive!uunet!oceania!sdd From: oceania!sdd (Steve Dakin) Subject: Re: Drawing direct to a dialog window... Message-ID: <1991May16.170121.7022@oceania.UUCP> Sender: sdd@oceania.UUCP Organization: Oceania Healthcare Systems References: <1991May15.131300.9898@umiami.ir.miami.edu> Date: Thu, 16 May 91 17:01:21 GMT 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 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). > I do this all the time. The only drawback (I have found) is those durn update events. I use a filter proc to handle all the updates. In order to handle the high volume of dialogs that I use and all the drawing that is associated with each one, I wrote a function whose primary purpose is to draw the graphics (lines, etc.) for each dialog box. Inside the filter proc I use, under the updateEvt event, I call this routine to have the text drawn. It's a little bit of a kludge, but it works quite well and I only have to use one filter proc and manage one routine for all the drawing (yes, this routine does get quite large after a while, but only a small portion of it is executed each time through). User Items didn't provide enough functionality for what I wanted so I went for this method instead. Woul someone who is more familiar with User Items want to expand on them? -- +-----------------------------------+ | Steve Dakin | | oceania!sdd@uunet.uu.net | | (NeXT mail) | | tread lighty so others may follow | +-----------------------------------+ -- +-----------------------------------+ | Steve Dakin | | oceania!sdd@uunet.uu.net | | (NeXT mail) |