PtDamageWidget & threads

I am developing a Photon app consisting of two threads. The main thread
handles all the user interaction and the second (message) thread receives
Neutrino pulses. The main thread has a PtRaw on top of a PtOSContainer that
draws a graph. The idea is that when a Neutrino pulse arrives, signalling
that new data has been put into a buffer, the graph gets updated.

However, if I call PtDamageWidget( ABW_Graph) from within the message thread
the graph is not redrawn. Yes, I am using PtEnter/PtLeave. If I set up a
timer in the primary thread and call PtDamageWidget( ABW_Graph) then I
obtain a regular update of the graph. In both cases the graph is redrawn
correctly if it is damaged by moving other windows in front of it.

What am I doing wrong?

Jim Douglas

Hi Jim,

Try a PtFlush() after the PtDamageWidget(ABW_Graph), if this doesn’t improve it. Post what results you do get.

Thanks
Brenda

Previously, Jim Douglas wrote in qdn.public.qnxrtp.photon:

I am developing a Photon app consisting of two threads. The main thread
handles all the user interaction and the second (message) thread receives
Neutrino pulses. The main thread has a PtRaw on top of a PtOSContainer that
draws a graph. The idea is that when a Neutrino pulse arrives, signalling
that new data has been put into a buffer, the graph gets updated.

However, if I call PtDamageWidget( ABW_Graph) from within the message thread
the graph is not redrawn. Yes, I am using PtEnter/PtLeave. If I set up a
timer in the primary thread and call PtDamageWidget( ABW_Graph) then I
obtain a regular update of the graph. In both cases the graph is redrawn
correctly if it is damaged by moving other windows in front of it.

What am I doing wrong?

Jim Douglas
\

Thanks. That fixes the problem. It has also been pointed out to me that the
PtFlush() documentation mentions the fact that (quote)

‘You’ll need to call this function explicitly if you’re drawing somewhere
“outside” the standard Photon event loop…’

Can anyone explain the logic behind this ‘feature’?

Jim

“Brenda Merpaw” <gui@qnx.com> wrote in message
news:Voyager.010517160139.569377C@bmerpaw…

Hi Jim,

Try a PtFlush() after the PtDamageWidget(ABW_Graph), if this doesn’t
improve it. Post what results you do get.

Thanks
Brenda

Previously, Jim Douglas wrote in qdn.public.qnxrtp.photon:
I am developing a Photon app consisting of two threads. The main thread
handles all the user interaction and the second (message) thread
receives
Neutrino pulses. The main thread has a PtRaw on top of a PtOSContainer
that
draws a graph. The idea is that when a Neutrino pulse arrives,
signalling
that new data has been put into a buffer, the graph gets updated.

However, if I call PtDamageWidget( ABW_Graph) from within the message
thread
the graph is not redrawn. Yes, I am using PtEnter/PtLeave. If I set up a
timer in the primary thread and call PtDamageWidget( ABW_Graph) then I
obtain a regular update of the graph. In both cases the graph is redrawn
correctly if it is damaged by moving other windows in front of it.

What am I doing wrong?

Jim Douglas

\