Trouble with graphics display in OS X

James Hurley jhurley at infostations.com
Thu Jan 13 20:34:08 EST 2005


Klaus and Ken,

I'm sorry I didn't make myself clear. I was hoping to avoid unnecessary detail.

The reason I can't make use of your suggestions, all of which are 
excellent and appropriate to the  specific handler I  presented, is 
that my problems apply to a set of generic handlers I use in an 
altered form of Turtle Graphics, one in which the graphics commands 
apply not to a drawing cursor (as in the normal TG) but the any 
graphic object. In this way one can tell an object (button, oval, 
field, etc.) to go Forward 10 pixels, turn right 45 degrees, set the 
heading in the direction of some other object and go forward half the 
distance to that object. Etc.

I have a large number of applications using this basic graphics 
vocabulary. So you can see why I can't use  Move in x millisec. Each 
application presents a different set of circumstances and there is no 
way to anticipate in each circumstance how long the object should 
take in making a particular move. The motion is generally dynamic. In 
the case of a planet moving about the sun, the motion is fast near 
the sun and slow away from the sun.

And if I were to truncate the graphic coordinates in each repeat 
loop--of which there may be hundreds--the program slow down 
considerably.

So far my best solution is to add the wait line in the handler 
employed by all TG commands which requires the movement of an object:

    wait 0 millisec

Turns out this  is shorter than wait 1 millisec. This wait  command 
appears to force a graphic display. (But the problem with "wait 0 
millisec" is that this slows things down a fair bit--not just one 
execution, but the hundreds that might be involved in a loop.)

In so doing, each "set the loc of..." is executed *and* displayed in 
OS X. Without this line, the movement is  displayed at only a few 
points along the path--and sometimes only the starting point and the 
ending point. Instead of moving steadily around an ellipse, it may 
not be seen to move at all, displaying only the starting point and 
the ending point which are the same.

In short, my problems lie with a set of basic tools which are applied 
to  a variety of  problems. They work find in Mac OS 9 and Windows 
but not in Mac OS X.

Sorry to be so long winded. This was what I was hoping to avoid.

Jim


More information about the use-livecode mailing list