views:

110

answers:

2

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.)

A: 

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?

iondiode
Unfortunately, I need support for images, so I need the full RichTextCtrl.
Sam
A: 

This is a bug in wxRitchText see http://trac.wxwidgets.org/ticket/9382

Also instead of wx.TE_MULTILINE|wx.TE_READONLY you should be using values from richtext module i.e. wx.richtext.RE_MULTILINE |wx.richtext.RE_READONLY, though that doesn't make any difference, still.

Anurag Uniyal