[comp.sys.mac.programmer] TEWoes, or when does TEKey not update?

kevin@kosman.UUCP (Kevin O'Gorman) (07/19/89)

I'm looking for any comments and suggestions on the following events:

I ported Crystal Cave from UNIX to the Mac on LSC 2.15, and it seemed to
work.  It was my very first Mac program, so I was pleased.  I ported it to
THINK C 3.0, and it still seemed okay, so I sent it off to comp.binaries.mac.

It's been a while and I haven't seen it here, but it seems to be out on the
net somewhere, because I'm starting to get bug reports.  And they puzzle me.
People told me that "after a while" the stuff they typed no longer would
show up on the screen.  They could save the game and restore it, and all
would be well for another while.

I tried this under the THINK C debugger, and could not get it to happen, but
it does indeed happen when running standalone.  Weird.

One savvy user had suggested I was getting a full TE record, so I used TMON
to check that.  While I goofed and did release a version that does not
truncate the record, the thing was pretty well frozen with 12.5 K bytes in
the record, which should be pretty comfortable.  I stepped through the input
loop, and there's a perfectly normal call to TEKey.  It returns okay, but the
screen is not updated, and hText has no more characters in it.

Well, I was fiddling around anyway, so I started selecting text and seeing
if I was updating the menus right.  I was, but after a Copy, sometimes the
selection range highlight had become permanent.  This seemed to go away if
I changed the monitor to 2-colors.  I went back to 256 and it was still okay
for a while, but then with repeated attempts, I could get a permanent
highlight again.

The oddest thing was that at this point, the original problem had gone away,
and I could continue typing to the program.

I hardly know where to start looking, though it does seem to be a good idea
to put in a truncation algorithm on the TE record.

Help?