Is there a way in wxpython to show a multi-color single line textCtrl. I used setForeGroundColor() and it changes the whole Text. I need something where I can make some characters of String in different color like Blue and other some characters in say Green and some others in Red? I found that Tinker is able use tag methods and do this stuff but I could not merge wxpython and Tinker applications.
Hope someone can help me.
Is there a way in wxpython to show a multi-color single line textCtrl. I used setForeGroundColor() and it changes the whole Text. I need something where I can make some characters of String in different color like Blue and other some characters in say Green and some others in Red?
The wx.TextCtrl uses the operating system’s native text control, in part so the application feels familiar. For all of the systems, the native text control is quite primitive and doesn’t allow formatting.
If you need formatting, you can use a wx.StyledTextCtrl. It does allow styling of the text within the control.
I found that Tinker is able use tag methods and do this stuff but I could not merge wxpython and Tinker applications.
Tk doesn’t EVER use the system’s native controls. It always draws every pixel of every control. They can add more fancy features, but the applications don’t look like Windows apps when run on Windows.
···
On Aug 15, 2014, at 5:04 PM, anjila tamrakar tamrakar.angela@gmail.com wrote:
–
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
You need to set the textCtrl to rich text 2 (style=wx.TE_RICH2) then
use YourTextCtrl.SetStyle(44, 47, wx.TextAttr(“RED”, “YELLOW”))
where 44 & 47 are the start and end character counts for the bit
you need to be red with a yellow background.
Gadget/Steve
···
On 16/08/14 01:04, anjila tamrakar
wrote:
Is there a way in wxpython to show a multi-color
single line textCtrl. I used setForeGroundColor() and it changes
the whole Text. I need something where I can make some
characters of String in different color like Blue and other some
characters in say Green and some others in Red? I found that
Tinker is able use tag methods and do this stuff but I could not
merge wxpython and Tinker applications.
Hope someone can help me.
–
You received this message because you are subscribed to the Google
Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it,
send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
(Lifted from the demo)