Search code examples
python-3.xwxpython

Does wxPython's text widget support custom text decorators?


I'm looking for a cross-platform rich text widget that supports non-trivial markup including the following, and I wonder if wxPython's text widget can be extended to do them:

  • set text background color
  • draw lines over and under text
  • draw borders around text
  • decorate content by overlaying lines and shapes (e.g., filled circles)
  • indicate items in a gutter

To give you an idea, look at the middle pane here:

enter image description here

I found wxRichTextCtrl, but I can't tell whether these kinds of decorators are supported of not.

Thanks very much.


Solution

  • You can check out the wxPython demo package to see what all it supports. However I can tell you right now that it does not do everything you want. You can probably do what you want by creating a custom widget or just by drawing everything yourself though.

    If these are hard requirements, I would recommend checking out another Python GUI toolkit