Imagebutton not branching.
Posted: Tue May 10, 2016 8:51 am
There appears to be a problem with imagebutton branching (Alpha24) - the instruction is recognised and displays the image, but if clicked, the specified branch is never reached. I've tried the branch with and without square brackets (the lang ref doesn't show sq brkts, but I guessed they are needed same as for the ordinary button instruction).
I cloned the identical non-working lines and converted them to ordinary buttons, which do work fine.
I've left both types of buttons so you can see in the example that clicking an ordinary button toggles the led and display the different image, but clicking the image does nothing because it never reaches the specified branch.
Any test pics should show the problem even if they are both the same.
I cloned the identical non-working lines and converted them to ordinary buttons, which do work fine.
I've left both types of buttons so you can see in the example that clicking an ordinary button toggles the led and display the different image, but clicking the image does nothing because it never reaches the specified branch.
Any test pics should show the problem even if they are both the same.
Code: Select all
let pin = 1
let pinstatus = 1
po pin pinstatus
[home]
cls
if pinstatus == 0 then button "routerOFF.jpg" [toggle]
if pinstatus == 1 then button "routerON.jpg" [toggle]
if pinstatus == 0 then imagebutton "routerOFF.jpg" [toggle]
if pinstatus == 1 then imagebutton "routerON.jpg" [toggle]
wait
[toggle]
if pinstatus == 0 then pinstatus = 1 else pinstatus = 0
po pin pinstatus
'end ' uncommenting this proves that the imagebuttons never branch here, but the ordinary buttons do
goto [home] repaints the browser screen then waits for events
wait ' this is in case wait was required in the branch, but it wouldn't ever be reached here