Setting foreground colour in a text control

Hi All,

I am redirecting the console output to a text control widget. In the
console output, the word "FAIL" occurs at many places. What I want to
do is, wherever in the text control the word "FAIL" occurs I want to
make the word FAIL appear in red colour. Kindly tell me how to do it.

Thanks in advance,
Spondita

Change your text control to either have a style wx.TE_RICH or an html
text control and set the colours as appropriate, (the html control is
simpler as you just need to replace the word FAIL with the same word
surrounded by an appropriate pair of tags the rich text you will need to
find the location(s), and either set the style after adding your new
text or split the text and change styles as you add it).

Gadget/Steve

···

On 16/05/2012 12:51 PM, Spondita wrote:

Hi All,

I am redirecting the console output to a text control widget. In the
console output, the word "FAIL" occurs at many places. What I want to
do is, wherever in the text control the word "FAIL" occurs I want to
make the word FAIL appear in red colour. Kindly tell me how to do it.

Thanks in advance,
Spondita

See the "wxTextCtrl Styles" section in the 2.9 C++ docs for wxTextCtrl.

···

On 5/16/12 4:51 AM, Spondita wrote:

Hi All,

I am redirecting the console output to a text control widget. In the
console output, the word "FAIL" occurs at many places. What I want to
do is, wherever in the text control the word "FAIL" occurs I want to
make the word FAIL appear in red colour. Kindly tell me how to do it.

--
Robin Dunn
Software Craftsman