[comp.sys.mac.programmer] Does a window have to come up white?

rothberg@polya.Stanford.EDU (Edward Rothberg) (10/13/88)

I have a program in which the user needs to concentrate on the
information in a few windows.  In MultiFinder, it's just too
distracting to have all those other windows behind mine.
So what I want to do is have a fake desktop, a gray window the
size of the entire screen.  I only want to do this when the
user is actively using the my program, with things returning
to normal when it's not being used.

So, what do I do?  I tried opening an invisible window, setting
it's background pattern to gray, and then calling ShowWindow().
Unfortunately, the window comes up white, and doesn't go to
gray until I call an EraseRect().  As you could imagine, it
is extremely distracting to have this flash of white before
things go to gray.  Is there any way to gray out all of the
screen except the menu bar without having a flash of white
first and without being extremely MultiFinder unfriendly (i.e.
not using a window)?

Ed Rothberg
rothberg@polya.stanford.edu

pane@cat.cmu.edu (John Pane) (10/13/88)

In article <4412@polya.Stanford.EDU> rothberg@polya.Stanford.EDU (Edward Rothberg) writes:
>...
>So, what do I do?  I tried opening an invisible window, setting
>it's background pattern to gray, and then calling ShowWindow().
>Unfortunately, the window comes up white, and doesn't go to
>gray until I call an EraseRect().  As you could imagine, it
>is extremely distracting to have this flash of white before
>things go to gray.  Is there any way to gray out all of the
>screen except the menu bar without having a flash of white
>first and without being extremely MultiFinder unfriendly (i.e.
>not using a window)?
>
>Ed Rothberg
>rothberg@polya.stanford.edu

See the assembly-language note in the entry for PaintOne, Window Manager, 
IM Volume 1.  The following MPW assembly language works for me:

	MAIN
noPaintWhite PROC EXPORT
	INCLUDE 'ToolEqu.a'

	CLR.W	PaintWhite
	RTS

	END


John Pane
Department of Computer Science
Carnegie Mellon University
pane@cs.cmu.edu
(412) 268-5884

bob@eecs.nwu.edu (Bob Hablutzel) (10/13/88)

> So, what do I do?  I tried opening an invisible window, setting
> it's background pattern to gray, and then calling ShowWindow().
> Unfortunately, the window comes up white, and doesn't go to
> gray until I call an EraseRect().  As you could imagine, it
> is extremely distracting to have this flash of white before
> things go to gray.  Is there any way to gray out all of the
> screen except the menu bar without having a flash of white
> first and without being extremely MultiFinder unfriendly (i.e.
> not using a window)?

One idea: Have you tried FillRect( Window^.portRect, pattern), before
you show the window?