[comp.sys.mac.programmer] Looking for TE + scrolling source examples

jtn@ADS.COM (John T. Nelson) (12/04/90)

I'm writing an application that uses the TE package.  Basically, what
I'm trying to do is write text that I read from a file onto a couple
of TE regions which are on top of a Dialog Window.  It's a dialog
because I have controls studded on the surface of the dialog which I
use to control the text being written to the TE regions.

Does anyone have example source code that does this sort of thing and
controls the flow of text to the individual regsions, controls their
scrolling and also handles the controls.  This is not trivial.  I
often get artifacts (garbage characters at the end of lines I write)
on the screen and the scrolling control is also non-trivial.  Notice
that I don't interact with the scrolling region so forget about click
loops and TrackControl.

Oh... one thing I have noticed that might be of interest to everyone.
If I pass a pointer to a region in memory containing text which I have
just malloc'd to the function TESetText then everything is okay fine.
If I realloc the region of memory and then pass the pointer to
TESetText, TECalText (I think that's it) blows up trying to
recalculate the region.  Strange because it only happens after a
realloc.  The use of NewHandle seems to work better.  Looks like LSC
memory management and the TE package have a problem.

So anyway, I'd love to see example code ou;t there of how you folks
handle what seems to be a simple matter of writing text to a
window/dialog.

Enjoy!



--
ORGANIZATION:  Advanced Decision Systems   GEOGRAPHIC: Arlington, VA
UUCP:          kzin!speaker@mimsy.umd.edu  INTERNET:   jtn@potomac.ads.com
SPOKEN:        John T. Nelson              PHONE:      (703) 243-1611
PROJECT:        Macintosh hacking -- "Love the Machine... Hate the Company"