Search code examples
pythonwxpythonwxwidgets

Horizontal scrolling in a wx.RichTextCtrl


I have a RichTextCtrl created as follows:

self.userlist = wx.richtext.RichTextCtrl(self, style=wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL)

It all works fine, except for the wx.HSCROLL style. If I change the RichTextCtrl to a regular TextCtrl, it correctly horizontal scrolls on long lines, rather than wrapping, but on the RichTextCtrl it wraps regardless. Is there an easy way to make it scroll horizontally? (I do, unfortunately, need the RichTextCtrl's featureset for this object.)


Solution

  • sorry, I can't post this as a comment as I don't have the reputation, and I'm not sure this is an answer per se

    http://trac.wxwidgets.org/ticket/9382 it looks old, but I confirm the behaviour you are seeing.

    Does setting the wx.TE_RICH or wx.TE_RICH2 on a regular TextCtrl give you the behaviour you need?