Changing PtNumericInteger

I am trying to use a pushbutton to increment a Numeric Integer widget and
also disply the next in a series of images. The button callback does
indeed increment the numeric value of the numeric widget and display the
proper image - but it does not update the displayed value in the numeric
widget. I am calling PtDamageWidget and PtFlush followed by a delay and I
still see no change in the numeric widget’s displayed value until I click
on the widget. This seems like pretty basic stuff - is there something I
am missing or is this just Photon being Photon?

Doug Owens

Can you post your code ?

“Doug Owens” <owens2@llnl.gov> wrote in message
news:cskaja$4ag$1@inn.qnx.com

I am trying to use a pushbutton to increment a Numeric Integer widget and
also disply the next in a series of images. The button callback does
indeed increment the numeric value of the numeric widget and display the
proper image - but it does not update the displayed value in the numeric
widget. I am calling PtDamageWidget and PtFlush followed by a delay and I
still see no change in the numeric widget’s displayed value until I click
on the widget. This seems like pretty basic stuff - is there something I
am missing or is this just Photon being Photon?

Doug Owens

“Doug Owens” <owens2@llnl.gov> wrote in message
news:cskaja$4ag$1@inn.qnx.com

I am trying to use a pushbutton to increment a Numeric Integer widget and
also disply the next in a series of images. The button callback does
indeed increment the numeric value of the numeric widget and display the
proper image - but it does not update the displayed value in the numeric
widget. I am calling PtDamageWidget and PtFlush followed by a delay and I
still see no change in the numeric widget’s displayed value until I click
on the widget. This seems like pretty basic stuff - is there something I
am missing or is this just Photon being Photon?

This code works for me:

int button_cb( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t
*cbinfo ) {
PtArg_t arg;
PtSetArg( &arg, Pt_ARG_NUMERIC_VALUE, 0, 0 );
PtGetResources( ABW_numeric, 1, &arg );
++arg.value;
PtSetResources( ABW_numeric, 1, &arg );
return( Pt_CONTINUE );
}

How is yours different?

I think I figured it out - I was doing a GetResource and incrementing the
returned value in place and then doing a SetResource. It seems Photon is
much happier if I copy the value to another variable and then increment
that value for the SetResource call. There are some warnings in the docs
but some good example code would have been nice.

Thanks,
Doug Owens
Misha Nefedov wrote:

Can you post your code ?

“Doug Owens” <> owens2@llnl.gov> > wrote in message
news:cskaja$4ag$> 1@inn.qnx.com> …
I am trying to use a pushbutton to increment a Numeric Integer widget and
also disply the next in a series of images. The button callback does
indeed increment the numeric value of the numeric widget and display the
proper image - but it does not update the displayed value in the numeric
widget. I am calling PtDamageWidget and PtFlush followed by a delay and I
still see no change in the numeric widget’s displayed value until I click
on the widget. This seems like pretty basic stuff - is there something I
am missing or is this just Photon being Photon?

Doug Owens