Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!dlyons From: dlyons@Apple.COM (David Lyons) Newsgroups: comp.sys.apple Subject: Re: 2 more //gs programming questions Message-ID: <32825@apple.Apple.COM> Date: 1 Jul 89 23:14:56 GMT References: <8907011229.AA12157@decwrl.dec.com> Organization: Apple Computer Inc, Cupertino, CA Lines: 58 In article <8907011229.AA12157@decwrl.dec.com> shatara@memit.dec.com (Chris: 223-8753, TECHNOLOGY OFFICE, MLO1-4/T35) writes: >Dave, you cought my interest on this one! As usual I have several >questions as I tried implementing this and it didn't quite work as I would >have expected it to. > >1. I am assuming that the Window Definition Procedure pointed to by > wContDefProc is used for updating the window contents as well as > drawing them for the first time. Yes; drawing the content "the first time" is not distinguished from drawing it or part of it later. When you create a window, the update region is initially wide-open, so an update event occurs automatically. >2. Your statement above implies that BeginUpdate (and hence EndUpdate) has > has already been called when I unter the Window Def Procedure after an > update event. Is this true. Yes. If you're using TaskMaster, here's what happens: TaskMaster gets an Update event (by calling GetNextEvent internally). It notices that your window has a nonzero entry for wContDefProc, so it calls BeginUpdate on your window, calls your wContDefProc procedure, and finally calls EndUpdate on your window. If you're *not* using TaskMaster (or if your window has a zero value for wContDefProc), then your program will receive Update events itself, and you should call BeginUpdate and EndUpdate yourself. Note that the name for the "wContDefProc" routine is the "Draw content routine," not to be confused with a "window definition procedure" (or "window defproc"), used for custom windows. (If you want a triangle- shaped window, for example, you'd have to write a window defproc.) >3. re 1. above, when the window is first created on the desktop, calling > GetVisHandle()^^.bBOX will yield a rectangle of what size? ..I would > expect (hope) the size of the content region. Well, the most precise statement I can make about GetVisHandle()^^.bBox is that it's the bounding rectangle of the window's VisRegion. Right after you create a window *in front* of all other windows, the VisRegion will be the same as the Content Region, *BUT* the VisRegion is in the window's local coordinate system, and the Content Region is in global coordinates. Be careful. >4. How does GetVIsHandle differentiate from the region needing to be > updated on the mainscreen and a region of a window on the screen. I don't understand the question. The VisRegion just indicates which parts of the window are visible. Any part that is off the screen or behind another window won't be in the VisRegion. --Dave Lyons, Apple Computer, Inc. | DAL Systems AppleLink--Apple Edition: DAVE.LYONS | P.O. Box 875 AppleLink--Personal Edition: Dave Lyons | Cupertino, CA 95015-0875 GEnie: D.LYONS2 or DAVE.LYONS CompuServe: 72177,3233 Internet/BITNET: dlyons@apple.com UUCP: ...!ames!apple!dlyons My opinions are my own, not Apple's.