PtToggleButton ?

bridged with qdn.public.photon
Post Reply
Jan Maria

PtToggleButton ?

Post by Jan Maria » Fri Sep 05, 2003 1:48 pm

Hi !
Wich resource should I change in PtToggleButton (using PtSetResource()
func.) to change state from 'Unset' to 'Set' ?
Or maybe should I do it in another way ?

Thanks !

JM

Dave Boltz

Re: PtToggleButton ?

Post by Dave Boltz » Fri Sep 05, 2003 3:30 pm

Hello Jan,

You can do this with the Pt_SET flag in the Pt_ARG_FLAGS resource.
For example if you want to set a label text to show if the flag is set or
not you could use something like the following.

unsigned long *flags;
PtGetResource( ABW_toggle, Pt_ARG_FLAGS, &flags, 0);
PtSetResource( ABW_label, Pt_ARG_TEXT_STRING, (*flags & Pt_SET) ? "Flag
is set":"Flag not set",0);

Regards,
Dave B.



"Jan Maria" <noemail@sorry.com> wrote in message
news:3F589419.5080605@sorry.com...
Hi !
Wich resource should I change in PtToggleButton (using PtSetResource()
func.) to change state from 'Unset' to 'Set' ?
Or maybe should I do it in another way ?

Thanks !

JM

Jan Maria

Re: PtToggleButton ?

Post by Jan Maria » Fri Sep 05, 2003 5:40 pm

Thanks!

U¿ytkownik "Dave Boltz" <dboltz@qnx.com> napisa³ w wiadomo¶ci
news:bja9q0$fe2$1@nntp.qnx.com...
Hello Jan,

You can do this with the Pt_SET flag in the Pt_ARG_FLAGS resource.
For example if you want to set a label text to show if the flag is set or
not you could use something like the following.

unsigned long *flags;
PtGetResource( ABW_toggle, Pt_ARG_FLAGS, &flags, 0);
PtSetResource( ABW_label, Pt_ARG_TEXT_STRING, (*flags & Pt_SET) ?
"Flag
is set":"Flag not set",0);

Regards,
Dave B.


Post Reply

Return to “qdn.public.photon”