GetGadgetItemState #PB_ListIcon_Checked (PB 5.30)

Just starting out? Need help? Post your questions and find answers here.
maslobojik
User
User
Posts: 36
Joined: Thu Jul 11, 2013 11:17 pm

GetGadgetItemState #PB_ListIcon_Checked (PB 5.30)

Post by maslobojik »

PureBasic (5.30).

If ListIconGadget with #PB_ListIcon_CheckBoxes flag then GetGadgetItemState return value 3 of #PB_ListIcon_Checked. But #PB_ListIcon_Checked = 2
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: GetGadgetItemState #PB_ListIcon_Checked (PB 5.30)

Post by PB »

Please post code showing the problem, because I bet you're
not checking it with the & symbol like the Help says. ;)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: GetGadgetItemState #PB_ListIcon_Checked (PB 5.30)

Post by netmaestro »

3 & #PB_ListIcon_Checked = 2, which is not equal to 0, so it works. You can't test the gadget item state = #PB_ListIcon_Checked because it also contains other states. Just check if the bit you are interested is set or not. Use a bitwise AND.
BERESHEIT
Post Reply