I’m trying to create a dialog where the user will be able to select one or
more options
via toggle buttons and also set or clear all toggle buttons by pressing a
Set/Clear All
button. We’ve been using the following code to read and manipulate the
visible
state of toggle buttons:
/***************************************************************************
READ_OFF_ON
*******/
int read_off_on( PtWidget_t *widget)
{
PtArg_t arg[1];
ushort_t *flags_ptr;
PtSetArg (&arg, Pt_ARG_FLAGS, &flags_ptr, 0);
PtGetResources (widget, 1, &arg);
if ( (*flags_ptr & Pt_SET) != 0)
return ON;
else
return OFF;
}
/***************************************************************************
WRITE_OFF_ON
*******/
void write_off_on( int value, PtWidget_t *widget)
{
PtArg_t arg[1];
ushort_t *flags_ptr;
PtSetArg (&arg, Pt_ARG_FLAGS, &flags_ptr, 0);
PtGetResources (widget, 1, &arg);
if ( value == 0)
*flags_ptr &= ~Pt_SET;
else
*flags_ptr |= Pt_SET;
}
This approach worked for apps built with PhAB 1.11 and 1.12, but the
write_off_on() function doesn’t seem to work for the code I’m trying to
implement using PhAB 1.13.
Any suggestions, insights, etc., will be appreciated.
TIA,
Dan Garber
dgarber@webcraft.com