#TEXT Resource Display
14-Jul-93 16:26:23
Sb: #131813-#TEXT Resource Display
Fm: Brian Fitzgerald 72250,3226
To: Ron Whatley 70673,542
> How does one go about displaying text stored in a TEXT resource?
> Got any sample Pascal code?
Something like this:
textH := GetResource( 'TEXT', resID );
HLock( textH );
SetRect( dispRect, 50, 50, 350, 150 );
TextBox( textH^, GetHandleSize( textH ), dispRect, teJustLeft );
HUnlock( textH );
ReleaseResource( textH );
Of course, this won't scroll or anything. If you want to scroll through text,
then you'll probably want to put the text from the resource into a TextEdit
record, add a few scroll bars, etc etc. That's about 100-500 lines of code (100
lines for uncommented spaghetti, 500 lines for nice modular reusable code).