Hi, What I want to do is display some text that is outputted to a TextArea in a certain colour, say red for errors.
when I use SetTextAreaColor, this changes the colour of the text already in the TextArea and the new text as well.
How can you change the colour of the new text (i.e text to be added) without changing the whole TextArea?
Here is an example of the problem, I used a function for this test as that is how it is in my main project.
Blitz is up to date and I just synch'd the modules just in case.
win = CreateWindow("test",0,0,640,480)
box = CreateTextArea(0,0,640,480,win)
display(box, "hello")
Function display (output : TGadget , text$)
AddTextAreaText(output , "some text")
' event loop so I can see what is happening.
While WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
Exit
End Select
Wend
'this changes "some text to green"
SetTextAreaColor(output , 0 , 255 , 0)
While WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
Exit
End Select
Wend
' adds more green text.
AddTextAreaText(output , text$)
End Function
While WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
End
End Select
Wend
Thanks
|