Problem with PtDamgeWidget

I have an App with two threads. One is the user interface thread and the the
other is a non user interface thread responsible for data collection. The
non user interface thread calls PtDamageWidget to cause repainting of a Raw
Widget with updated data. Ex.
PtEnter(0);
PtDamageWidget(raw_widget);
PtLeave(0);

For some reason the widget is never repainted unless a window covers it or
the
mouse moves inside the main window. Its like repaint event dose not get
dispatched until another event is dispatched.

To fix the problem I now use this

PtEnter(0);
PtDamageWdiget(raw_widget);
PtHold();
PtRelease();
PtLeave(0);

This fixes the problem and the widget updates, but the strange thing is
PtHold() returns
1 meaning their was no lock on updating and PtRelease returns 0 as expected.


Can anyone explain this behavior?

thanks,

Kevin

Hello Kevin,

In the docs is reads, if you want the widget to be redrawn immediately,
call PtFlush() after you call PtDamageWidget().

Regards,
Dave B.




Kevin Brown wrote:

I have an App with two threads. One is the user interface thread and the the
other is a non user interface thread responsible for data collection. The
non user interface thread calls PtDamageWidget to cause repainting of a Raw
Widget with updated data. Ex.
PtEnter(0);
PtDamageWidget(raw_widget);
PtLeave(0);

For some reason the widget is never repainted unless a window covers it or
the
mouse moves inside the main window. Its like repaint event dose not get
dispatched until another event is dispatched.

To fix the problem I now use this

PtEnter(0);
PtDamageWdiget(raw_widget);
PtHold();
PtRelease();
PtLeave(0);

This fixes the problem and the widget updates, but the strange thing is
PtHold() returns
1 meaning their was no lock on updating and PtRelease returns 0 as expected.


Can anyone explain this behavior?

thanks,

Kevin

Hello Kevin,

FYI the PtFlush() is a workaround and there has been a problem report
submitted to have this fixed in the future.

Regards,
Dave B.



Hardware Support Account wrote:

Hello Kevin,

In the docs is reads, if you want the widget to be redrawn immediately,
call PtFlush() after you call PtDamageWidget().

Regards,
Dave B.




Kevin Brown wrote:

I have an App with two threads. One is the user interface thread and
the the
other is a non user interface thread responsible for data collection.
The
non user interface thread calls PtDamageWidget to cause repainting of
a Raw
Widget with updated data. Ex.
PtEnter(0);
PtDamageWidget(raw_widget);
PtLeave(0);

For some reason the widget is never repainted unless a window covers
it or
the
mouse moves inside the main window. Its like repaint event dose not get
dispatched until another event is dispatched.

To fix the problem I now use this

PtEnter(0);
PtDamageWdiget(raw_widget);
PtHold();
PtRelease();
PtLeave(0);

This fixes the problem and the widget updates, but the strange thing is
PtHold() returns
1 meaning their was no lock on updating and PtRelease returns 0 as
expected.


Can anyone explain this behavior?

thanks,

Kevin

\