TextField.BackgroundColor bug in Raspberry Pi compiler. With possible workaround

In RPi the below code does not change the BackgroundColor to white after being red.
However, I tried successfully using ‘near white’ instead of ‘white’,
i.e. &cFFFFFE instead of &cFFFFFF

Not thoroughly tested, but in my app this workaround worked.
Hope this helps someone.
Bugreport filed:
65049 - TextField.BackgroundColor bug in Raspberry Pi compiler. With possible workaround.

'TextField1 TextChange
'---------------------
'
if (me.Text.IsEmpty) or (Val(me.Text)=0) Or (Not IsNumeric(me.Text)) Then
  me.BackgroundColor=&cFF0000   'Red
else
  me.BackgroundColor=&cFFFFFF 'White  Stays Red
  'me.BackgroundColor=&cFFFFFE 'Near White  Works!
end if
'

I’m using Win10 Xojo 2021r1.1 and an RPi 4B with Raspbian 10 (buster).

Val(me.Text) = 0 // This could evaluate wrong since you can't really compare a double to 0.

Interesting, thanks.
But still a bug:
Make it even simpler, like:
if (me.Text.IsEmpty) Then
etcetera

Xojo make a huge MESS with the lack of a way to explicitly specify a System Color from the IDE.

So, if you use White in the background or Black in the text color, Xojo will NOT use those color, it will use the SYSTEM colors.

This is something that has being discussed a lot in the forum and your work around is the same that it is already there.

So, in your “bug report” it is probably to be closed as “by design”

BUT it is not a good idea to get rid of this behavior right now, because most of the time you want your controls to use the actual SYTEM’s text color for your controls, not a fixed color.

Better to vote for something that solves this problem, a way to set a system color in the IDE: feedback://showreport?report_id=53349

(I dont have 2019r3+ to test) but I think they introduced a colorgroup to kind of work with colors, but sounds messier that suport actual system colors in controls.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.