drawing one thing then another

Hello everyone,

I’m very new Photon, and have been having some difficulties with
something that seems simple. All that I’m using Photon for right now is
a little program that will draw one object (a square) followed by a red
dot in the center of the square, with a one second delay in between the
two draw events.

The first thing I tried was inserting a sleep(1) command in between the
2 commands that create the widgets. Instead of pausing in between the
two events, the program pauses at the command line for one second then
both drawn objects pop up.

So I figured that photon is loading everything into the draw buffer, and
isn’t drawing until the program is over. So I tried PgFlush() in
between the 2 functions that draw the objects, and still the program
would not draw one object followed by the other. I also tried
PgFFlush() and setting the buffer size very small, without success.

My question is how do I draw one thing then drawn another with a pause
in between.

I should probably add that I am not using phAB, and that I’m doing all
of the coding with vedit and running the programs from shells in
phindows.

Thanks for reading,

Mike Sherman
Department of Neurobiology and Physiology
Northwestern University
Evanston IL, 60201

Mike Sherman <m-sherman@northwestern.edu> wrote:

Hello everyone,

I’m very new Photon, and have been having some difficulties with
something that seems simple. All that I’m using Photon for right now is
a little program that will draw one object (a square) followed by a red
dot in the center of the square, with a one second delay in between the
two draw events.

If you’re drawing using the Pg*() functions, you’ll want to do
that drawing in the raw draw function of a PtRaw widget. That
widget will encapsulate all your drawing work.

To get the timing aspect, use a PtTimer. Use its callback
to tweak a global state variable, and then trigger the raw draw
function, which draws various things according to the state
variable. Set the resources of the PtTimer to do this at
whatever interval.

I hope this helps.


Norbert Black
QSSL Training Services