I have an app which I’ve been developing for a while under macOS. There is a textfield which acts as a status display - various parts of the app write a status message there, in red, green, or black. This works as expected. At the minute, I’m using Xojo 2017r2.1 under Mavericks.
Trying this in a VirtualBox VM under Win7, same Xojo version. Text is displayed in the textfield with the expected content, but it’s always black, and I’ve stepped through the method that writes out the text line, and it does set the colour, thus:
[code]ptr = MainWindow.LoggingTabs1.StatusBar
ptr.TextFont = “Verdana”
ptr.TextUnit = FontUnits.Pixel
ptr.TextSize = 12.0
ptr.Bold = True
ptr.Alignment = if (align=“middle”, TextArea.AlignCenter, TextArea.AlignLeft)
Select case colour
case “red”
ptr.TextColor = &cff0000 // Execution definitely passes here, …
case “green”
ptr.TextColor = &c008800
else
ptr.TextColor = &c000000
end Select
Dim d As Xojo.Core.Date = Xojo.Core.Date.Now
timestr = format (d.hour, “\ \ 0#\:”) + format (d.minute, "0#\ ")
ptr.Text = timestr.ToText + statusLine // … but the text comes out black.
[/code]
Is there some reason for this not working? Elsewhere, I use a label to perform a similar function and coloured text works there under Win7 so I could probably switch to using a label if necessary.