Pt_ARG_FLAGS does not set

bridged with qdn.public.photon
Post Reply
Sylvain

Pt_ARG_FLAGS does not set

Post by Sylvain » Tue Nov 04, 2003 10:24 pm

Hi,

I try to change the Pt_ARG_FLAGS, but he does not accept the new value why?
Here is my code :

int Stop( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )
{
int Code;
long Flags;

/* eliminate 'unreferenced' warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;

//Desable Pause button.
Flags = PtWidgetFlags(ABW_PtOnOffButtonPause);
printf("Flags = 0x%lX\n", Flags);
Flags &= ~Pt_SELECTABLE;
printf("Flags to write = 0x%lX\n", Flags);
PtSetResource(ABW_PtOnOffButtonPause, Pt_ARG_FLAGS, Flags, 0 );
Flags = PtWidgetFlags(ABW_PtOnOffButtonPause);
printf("Flags read back = 0x%lX\n", Flags);

....
....

return( Pt_CONTINUE );
}

Thanks

Warren Peece

Re: Pt_ARG_FLAGS does not set

Post by Warren Peece » Wed Nov 05, 2003 7:36 pm

Re-read the PtSetResource() documentation for flags. The second to the
last parameter, where you passed "Flags", is the mask, and the last
parameter which you passed as zero, is the value to set the bits to.
Zero is a set of all zero bits, One is just a single one bit, and what
you want to pass instead of zero is Pt_TRUE which is 0xFFFFFFFF (all one
bits). What you were doing is clearing the Pt_SELECTABLE flag, and only
the Pt_SELECTABLE flag.

Hope that helps.

Cheers,
-Warren "Bitmasked Avenger" Peece



Sylvain wrote:
Hi,

I try to change the Pt_ARG_FLAGS, but he does not accept the new value why?
Here is my code :

int Stop( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )
{
int Code;
long Flags;

/* eliminate 'unreferenced' warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;

//Desable Pause button.
Flags = PtWidgetFlags(ABW_PtOnOffButtonPause);
printf("Flags = 0x%lX\n", Flags);
Flags &= ~Pt_SELECTABLE;
printf("Flags to write = 0x%lX\n", Flags);
PtSetResource(ABW_PtOnOffButtonPause, Pt_ARG_FLAGS, Flags, 0 );
Flags = PtWidgetFlags(ABW_PtOnOffButtonPause);
printf("Flags read back = 0x%lX\n", Flags);

...
...

return( Pt_CONTINUE );
}

Thanks

Post Reply

Return to “qdn.public.photon”