I have not been able to get the arm fill to work for a PtOnOffButton, but I did
get the background color to change by checking the state of the button and changing
the color depending on that state. Here is a sample of code:
PtGetResource(widget, Pt_ARG_ONOFF_STATE, &state, 0);
if (state == 0) / means it is off /
PtSetResource(widget, Pt_ARG_FILL_COLOR, Pg_RED, 0);
else / means it is on */
PtSetResource(widget, Pt_ARG_FILL_COLOR, Pg_GREEN, 0);
another possibility is to use a regular PtButton and set it to toggle and then
you can use the resources to do the Pt_ARG_ARM_FILL and Pt_ARG_ARG_COLOR.
Hope this helps
Jean-Louis Villecroze <firstname.lastname@example.org> wrote:
I would like a PtOnOffButton that toggle when pressed (displaying an image)
to change it’s background color but I can’t make it working.
I’m setting the following resource of the widget :
But no luck, the widget when armed is always of the same gray color.
Thanks for any tips/help