Ubuntu Forums Archive Viewer

WxPython rich text in a variable

Archived thread 1003347 from Programming Talk. Markdown source: Programming_Talk/thread_1003347_WxPython_rich_text_in_a_variable.md

Original URL About this archive
#1

In WxPython, how do I put rich text in a variable?

I know how to make a rich text control, but that's not what I want.

I want to be able to manipulate the styled text in variables outside of my GUI and then pass it in later. I can't set the styles as I pass it as things are now.

Pseudo example of what I want: s = RichString("<b>This</b> is <color>a</color> test.")

OR

s = RichString("This is a test.") theStyle=TextAttrEx(…) s.append_TextAttrEx(theStyle)