Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: Wanted: a window that comes up in black Message-ID: <42643@apple.Apple.COM> Date: 5 Jul 90 01:22:46 GMT References: <1115@peyote.cactus.org> <3794@rodan.acs.syr.edu> <23026@dartvax.Dartmouth.EDU> Organization: Apple Computer Inc, Cupertino, CA Lines: 37 In article <23026@dartvax.Dartmouth.EDU> anarch@eleazar.dartmouth.edu (The Anarch) writes: > > Apologies if this is an elementary question; I'm still pretty new to Mac >programming. Anyway, I'm trying to get a window to come up onscreen with a >black content region. Now I know that I can easily do NewWindow and then >PaintRect the window's body, but that causes a brief white flash, which I'd >like to avoid but have been unable to get rid of. What I *have* tried: >changing the bkColor and bkPat for the window in various ways before a >ShowWindow; I haven't gotten any positive results. Here's one for the oneliners file: The window Mgr doesn't use your window's bkPat when erasing the content region. No. That would be too simple, too easy. Instead, since the content region is drawn in the WMgrPort, the Window Manager uses the WMgrPort's bkPat. Since this is always white, your window's content region is always drawn in white when it is updated. There are several not-so-good ways around this. As I recall, if you have a color window, the window's rgbBkColor IS respected, and you can have your window updated in any color you want (but not pattern). You can also try munging around with the PaintWhite low-memory global, which can be used to prevent the window manager from clearing your content region to any color at all, allowing you to do it. However, there are problems with that, as Inside Mac I-297 points out. Finally, you could write a WDEF wherein the entire window is a structure region, and where there is no content region. Since the WDEF is solely responsible for drawing the strucRgn, you will have total control over how it gets redrawn. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions