home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!spool.mu.edu!sdd.hp.com!decwrl!decwrl!apple!mumbo.apple.com!gallant.apple.com!seuss.apple.com!user
- From: absurd@apple.apple.com (Tim Dierks, software saboteur)
- Subject: Re: Complex window and popup v
- Sender: news@gallant.apple.com
- Message-ID: <absurd-091192191802@seuss.apple.com>
- Date: Tue, 10 Nov 1992 03:38:52 GMT
- Distribution: comp.sys.mac.programmer
- References: <ALESKINE.92Nov9221258@cardhu.cs.hut.fi>
- Organization: MacDTS Marauders
- Followup-To: comp.sys.mac.programmer
- Lines: 52
-
- In article <ALESKINE.92Nov9221258@cardhu.cs.hut.fi>, aleskine@cs.hut.fi
- (Arto Leskinen) wrote:
- > My window has similar look than finder's. So I do not want scrollbars all the
- > way. And I do not want line that goes up. Is there any way to stop drowing on
- > update?
- >
- > Now I draw white line on top of irritating line, but user has enough time to
- > see black line flashing before I remove it.
-
- This line is being draw by DrawGrowIcon(); it also draws the lines along
- the sides of the window. To keep it from drawing it all the way up, you
- can use the clipRgn to mask out that part of the window before calling
- DrawGrowIcon. What I generally do is make the clip region just the
- 16x16 square at the bottom right of the windoe before calling
- DrawGrowIcon; then it only draws the grow icon, and nothing else.
- Here's some code (off the top of my head, never compiled):
-
- void
- DrawGrowInWindow(WindowPtr window)
- { RgnHandle saveClip,newClip;
- Rect r;
- GrafPtr oldPort;
-
- GetPort(&oldPort);
- SetPort(window);
-
- saveClip = NewRgn();
- CopyRgn(window->clipRgn,saveClip);
-
- r = window->portRect;
- r.top = r.bottom - 16;
- r.left = r.right - 16;
- newClip = NewRgn();
- RectRgn(newClip,&r);
-
- SectRgn(saveClip,newClip,saveClip);
-
- SetClip(newClip);
-
- DrawGrowIcon();
-
- SetClip(saveClip);
-
- DisposeRgn(saveClip);
- DisposeRgn(newClip);
-
- SetPort(oldPort);
- }
-
- Enjoy;
- Tim Dierks
- MacDTS, but I speak for myself.
-