Anyway, the problem is that under a certain condition, GUI buttons are affected by a gui.settext command. The text width inside the button will overflow the button boundaries causing the 'activated' colour to overwrite other objects. This usually only happens after a few presses, but not of the same button and only occurs when (as far as I can discern) the text in the GUI text box is the result of an IF THEN statement ?!?!?!
There may be other conditions, but setting a simple variable does not show the effect.
This is with Annex32 CAN 1.60.3 LFS and tested on two different boards, one a ESP-2432S028 with ST7889 driver and one a ESP32 with standard ILI9341.
Also, it appears that the GUI handler is not fully reset on a program re-run as the previous run's screen will reappear after a TFT.INIT and a TFT.FILL, when a REFRESH or AUTOREFRESH is issued.
Code: [Local Link Removed for Guests]
tft.init 1
tft.fill black
GUI.INIT 10, black
pause 200
gui.autorefresh 100, 1
pause 200
Dummy = GUI.Line (0,0,0,0,0) ' Put valid buttons in 1-3 range
But1 = GUI.Button(10, 155, 100, 80, "BOX 1",1,0,0,0,white,blue,red,white)
But2 = GUI.Button(110, 155, 100, 80, "BOX 2",1,0,0,0,white,blue,red,white)
But3 = GUI.Button(210, 155, 100, 80, "BOX 3",1,0,0,0,white,blue,red,white)
TextBox1 = gui.textline 10,20,200,20," ",3,yellow,black,black,3
Btn = 0
gui.setevent But1, TOUCH, pressed
gui.setevent But2, TOUCH, pressed
gui.setevent But3, TOUCH, pressed
do
do
pause 50
loop until Btn <> 0
' Single line structure here, but same effect with full IF-THEN
if Btn = 1 then Result$ = "It's a Draw"
if Btn = 2 then Result$ = "Human Wins"
if Btn = 3 then Result$ = "Pooter Wins"
' Setting Result$ explicity does not cause the error
' Result$ = "Human Wins"
gui.settext TextBox1, result$
Btn = 0
pause 100
loop
Pressed:
Btn = gui.target
return