[comp.sys.mac.programmer] TCL doesn't work?

anderson@Apple.COM (Clark Anderson) (08/09/90)

Greetings:
I've run into something very strange with the Think
Class Libraries, and was hoping to hear some comments
from others who have used them. I've been on this
for 6 days and nights now, and I'm (fairly) sure there's
something wrong with the TCL. Even the boys at Symantec
admit it shouldn't take this long to do...

I'm trying to get a scrolling PICT. 
I started with an unmodified copy of the Starter project,
and added one global procedure and 2 global variables.
What I've done is declare a global pic handle and rect
to draw it into, and a global routine (gBuildPict)that does
the OpenPicture, quickdraw calls and Close Picture.
I have used both CPanorama and CPicture as the main pane
for the drawing, but neither of them work. When I
use CPicture, I call SetMacPicture(gPict).

So, after initializing the Panorama, I call the global
routine gBuildPict, which builds the pic handle. I also
tried calling it after intializing the application, and
the document, but it doesn't make any difference. (I only
call it once)

The draw method of the Panorama is overridden, and the comment
in there says "Draw your stuff here". Hokay...so I call
DrawPicture(gPict,gRect). Nothing shows up. I checked the size
of the pic (54 bytes) and the rectangle gRect and the rect inside
the pict, and they're both 0,0,1500,1500, which is correct.

So then I put the gBuildPict routine inside the draw routine, with
a boolean flag so that it gets built once on the first pass thru
the drawing routine, and on subsequent passes, it just calls
DrawPicture(gPict,gRect). Voila...the pict shows up, but when it's
scrolled, it's cut off (clipped) on the right and bottom. Not all
the picture shows up.

Then I took out the boolean flag, so that the PICT gets built,
then drawn, EVERY time thru the draw routine. Now the picture
scrolls correctly, and all of it shows up. This is true for
both CPanorama and CPicture.

Surely this can't be right? According to everyone I've talked to,
all I should need do is call DrawPicture. Using CPicture, I
shouldn't even need to do that, since inherited draw calls it.
Calling gBuildPict repeatedly works, but it burns up memory.

I am puzzled. Is there something obvious I've missed?

Any help would be appreciated...

                                            --clark

-- 
-----------------------------------------------------------
Clark Anderson                InterNet:  anderson@apple.com
PCB Software Tools            AppleLink: C.ANDERSON
Apple Computer, Inc           BellNet:   408-974-4593

"I speak only for myself, much to my employer's relief..."
-----------------------------------------------------------