Disarming a toggle button by program

hello, all!

does anybody know how to disarm a toggle button by program?

Thanks for your help,

FB

You can disable a widget with something like this:

PtArg_t Args[2];
PtSetArg(&Args[0],Pt_ARG_FLAGS,Pt_BLOCKED,Pt_BLOCKED);
PtSetArg(&Args[1],Pt_ARG_FLAGS,Pt_GHOST,Pt_GHOST);
PtSetResources(widget, 2, (PtArg_t *) &Args );

the blocked line stops the button from working, and the ghost line greys it out.

HTH

Garry

Thanks Garry!

I think I was not clear enough.
Actually, by disarming, I did not mean inhibiting, but simply returning
the toggle (or radio) button to its “unpressed” state.

THanks again,

FB

I am not in qnx right now, but what you need to do is to unset the Pt_SELECTED flag, i THINK it is in the Pt_ARG_FLAGS resource.

so PtSetResource(w,Pt_ARG_FLAGS,Pt_SELECTED,Pt_FALSE); should do it
cheers!

Pt_SET might be worth a look too.

Thanks a lot for your help:P
indeed,
PtSetResource(widget,Pt_ARG_FLAGS,Pt_FALSE,Pt_SET);
(note that Pt_FALSE must be the THIRD argument)
returns a toggle button to its unpressed state.

FB