home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / mac / programm / 18214 < prev    next >
Encoding:
Text File  |  1992-11-09  |  2.0 KB  |  66 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. 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
  3. From: absurd@apple.apple.com (Tim Dierks, software saboteur)
  4. Subject: Re: Complex window and popup v
  5. Sender: news@gallant.apple.com
  6. Message-ID: <absurd-091192191802@seuss.apple.com>
  7. Date: Tue, 10 Nov 1992 03:38:52 GMT
  8. Distribution: comp.sys.mac.programmer
  9. References: <ALESKINE.92Nov9221258@cardhu.cs.hut.fi>
  10. Organization: MacDTS Marauders
  11. Followup-To: comp.sys.mac.programmer
  12. Lines: 52
  13.  
  14. In article <ALESKINE.92Nov9221258@cardhu.cs.hut.fi>, aleskine@cs.hut.fi
  15. (Arto Leskinen) wrote:
  16. > My window has similar look than finder's. So I do not want scrollbars all the
  17. > way. And I do not want line that goes up. Is there any way to stop drowing on
  18. > update?
  19. > Now I draw white line on top of irritating line, but user has enough time to
  20. > see black line flashing before I remove it.
  21.  
  22. This line is being draw by DrawGrowIcon(); it also draws the lines along
  23. the sides of the window.  To keep it from drawing it all the way up, you
  24. can use the clipRgn to mask out that part of the window before calling
  25. DrawGrowIcon.  What I generally do is make the clip region just the
  26. 16x16 square at the bottom right of the windoe before calling
  27. DrawGrowIcon; then it only draws the grow icon, and nothing else.
  28. Here's some code (off the top of my head, never compiled):
  29.  
  30. void
  31. DrawGrowInWindow(WindowPtr window)
  32. {   RgnHandle       saveClip,newClip;
  33.     Rect            r;
  34.     GrafPtr         oldPort;
  35.     
  36.     GetPort(&oldPort);
  37.     SetPort(window);
  38.  
  39.     saveClip = NewRgn();
  40.     CopyRgn(window->clipRgn,saveClip);
  41.     
  42.     r = window->portRect;
  43.     r.top = r.bottom - 16;
  44.     r.left = r.right - 16;
  45.     newClip = NewRgn();
  46.     RectRgn(newClip,&r);
  47.  
  48.     SectRgn(saveClip,newClip,saveClip);
  49.     
  50.     SetClip(newClip);
  51.     
  52.     DrawGrowIcon();
  53.  
  54.     SetClip(saveClip);
  55.  
  56.     DisposeRgn(saveClip);
  57.     DisposeRgn(newClip);
  58.     
  59.     SetPort(oldPort);
  60. }
  61.  
  62. Enjoy;
  63. Tim Dierks
  64. MacDTS, but I speak for myself.
  65.