How to Unselect a PtButton

I would like to prevent a given combination of
gui inputs that are represented by PtButtons.

Does anyone know how to Unselect a PtButton
in code, once it has been Set (selected by the user)?

I have tried unsetting it with the Pt_SET flag set to Pt_FALSE,
but the green “On” light remains “On”.

Is there another method known to work?

tnx.
-GF

A green “On” light?

Are you sure it’s a PtButton and not a PtOnOffButton?

(If it indeed is a PtOnOffButton, Pt_ARG_ONOFF_STATE is the resource you
want to use.)

“Gordon Freeman” <gf@bigfoot.com> wrote in message
news:dsitem$pk3$1@inn.qnx.com

I would like to prevent a given combination of
gui inputs that are represented by PtButtons.

Does anyone know how to Unselect a PtButton
in code, once it has been Set (selected by the user)?

I have tried unsetting it with the Pt_SET flag set to Pt_FALSE,
but the green “On” light remains “On”.

Is there another method known to work?

tnx.
-GF

(If it indeed is a PtOnOffButton, Pt_ARG_ONOFF_STATE is the resource you
want to use.)

Yes, it is a PtOnOffButton. But setting/unsetting Pt_ARG_ONOFF_STATE does

not
give the expected result. It does not affect the green part of the button.
Instead, it
renders the button as if the mouse were being clicked on the button, but
never released.

Maybe this is a bug, but no matter, I have given up, don’t have the time to
spend
trying to fix it anymore. The user is free to make the wrong choices in the
gui, then
these bad choices can be handled elsewhere in the application.

tnx.
-GF

Gordon Freeman wrote:

(If it indeed is a PtOnOffButton, Pt_ARG_ONOFF_STATE is the resource you
want to use.)


Yes, it is a PtOnOffButton. But setting/unsetting Pt_ARG_ONOFF_STATE does
not
give the expected result. It does not affect the green part of the button.
Instead, it
renders the button as if the mouse were being clicked on the button, but
never released.

Maybe this is a bug, but no matter, I have given up, don’t have the time to
spend
trying to fix it anymore. The user is free to make the wrong choices in the
gui, then
these bad choices can be handled elsewhere in the application.


tnx.
-GF




I know this is late but this is a snippet of code we use to prevent the

change in a onoff button state.
if(i_b->i_flags & (I_EOUT | I_AOUT)) {
response = PtAskQuestion(ABW_base, NULL,
“Can’t stop clock\nwhile keeping data”,
“Helvetical09ba”,
“&Continue”, NULL, NULL, 1);

/* reset the onoff state of the widget to on */
PtSetArg(&args[0], Pt_ARG_ONOFF_STATE, 1, 0);
PtSetResources(widget, 1, &args[0]);
return( Pt_CONTINUE );
}
When this condition is true, the state of the button is already off.
The PtAskQuestion dialog is modal. The state reverts to on after the
user acknowledges the dialog.