[su.macintosh] QuickDraw/TextEdit question

philf@lindy.Stanford.EDU (Phil Fernandez) (07/04/89)

Hopefully someone can explain the following to me, and offer a solution.

My application prepares an off-screen bitmap, and draws a fairly
complex background image into it.  Then, I open a window and use
CopyBits to copy the background image to the active window grafPort.
I use the off-screen bitmap because the image needs to be sized and
srolled, and copying-in a rect from the bitmap seems much easier and
faster than regenerating the image.  Anyhow, this all works great.

My problem comes when I overlay a TextEdit Rect on top of the image.
Sequence looks like:

<generate image off-screen>
<New Window>
<CopyBits to new window's grafport>
<allocate text-edit record, destRect and viewRect == full window rect>

I find that TextEdit blanks the each line into which I enter text.
That is, if I start type into the first line of the TextEdit rect,
that entire line is cleared to white, wiping out the background image
I had placed there.

Similarly, as I move down to subsequent lines, the full line is
blanked as soon as I enter the line.

I checked the pen mode for my TERec -- it's srcOr, which in theory
should just OR bits into my image, not copy white bits.  I want the
textedit image to simply overlay the background image in my window,
and not clear anything.

Can anyone explain what's going on here?  Am I being dumb, or is this
some fact of life that I have to work around?  Any help would be appreciated.

phil